source: framspy/frams-test.py @ 1081

Last change on this file since 1081 was 1081, checked in by Maciej Komosinski, 3 years ago

Cosmetic

File size: 990 bytes
Line 
1import sys
2import frams
3
4framspath = sys.argv[1] # set to the directory where Framsticks binaries and libraries exist
5frams.init(framspath, "-Ddata")  # "-D"+os.path.join(framspath,"data")) # not possible (maybe python windows issue) because of the need for os.chdir(). So we assume "data" is where the dll/so is
6
7print('Available objects:', dir(frams))
8print()
9
10
11def extValueDetails(v):
12        return '"' + str(v) + '"    frams type=' + str(v._type()) + '    frams class=' + str(v._class()) + '    python type=' + str(type(v._value()))
13
14
15v = frams.String.deserialize('[100,2.2,"abc",[null,[]],XYZ[9,8,7]]')
16print(extValueDetails(v))
17for e in v:
18        print(extValueDetails(e))
19
20g = frams.GenePools[0].add('X')
21g.name = "py!"
22g.data['custom'] = 123.456
23g.data['a'] = 'b'
24
25for more in range(5):
26        frams.GenePools[0].add(frams.GenMan.mutate(g.geno))
27
28for g in frams.GenePools[0]:
29        print(str(g.index) + '. "' + str(g.name) + '"  ' + str(g.genotype) + '  data=' + str(g.data))
Note: See TracBrowser for help on using the repository browser.