forked from mnfienen/CVNetica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexperience_test.py
46 lines (31 loc) · 996 Bytes
/
experience_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import pythonNeticaUtils as pyn
import CV_tools as CVT
import numpy as np
import pickle, gzip
import sys
############
# CONFIGURATION FILE NAME
try:
parfile = sys.argv[1]
except:
parfile = 'example.xml'
############
# initialize
cdat = pyn.pynetica()
# read in the problem parameters
cdat.probpars = CVT.input_parameters(parfile)
# read in cas file
cdat.read_cas_file(cdat.probpars.baseCAS)
# Initialize a pynetica instance/env using password in a text file
cdat.start_environment(cdat.probpars.pwdfile)
junks = cdat.NodeParentIndexing(cdat.probpars.baseNET,cdat.probpars.baseCAS)
'''
# let's operate on a single example here for now
testnode = cdat.GetNodeNamed('islandwidth',cnet)
# get a list of the parents of the node
parents = cdat.GetNodeParents(testnode)
# for each parent, get its set of possible states
# now find how many possible node states there are
cartprod = cdat.SizeCartesianProduct(parents)
print cartprod
'''