Debian Codegraph @

07p/demos/r3b/data.py

raw symbols SCIP
1 from AUTOclui import *
2
3 def get(solution, eps=1e-3):
4 #construct a new constant solution based on the flq solution
5 PAR = solution.PAR
6 PAR['eps'] = eps
7 u = []
8 s0 = solution(0)
9 for i in range(6):
10 u.append(s0[i]+eps*s0[i+6])
11 p = {2:PAR(2),3:PAR(3),6:PAR(6),12:0}
12 # init PAR(21:23) to u[:3]
13 for i in range(3):
14 p[21+i] = u[i]
15 # init PAR(25:30) to USTART and PAR(31:36) to VSTART
16 for i in range(12):
17 p[25+i] = s0[i]
18 return load(u,PAR=p)
19
20 def create(sfile='flq',label=2):
21 solution = loadbd(s=sfile)(label)
22 save(get(solution,eps),'startman')
23
24 # This is the Python syntax for making a script runable
25 if __name__ == '__main__':
26 if len(sys.argv) > 2:
27 create(sys.argv[1], int(sys.argv[2]))
28 elif len(sys.argv) > 1:
29 create(sys.argv[1])
30 else:
31 create()
32