-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
75 lines (57 loc) · 1.45 KB
/
main.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env python
#-*- coding:utf-8 -*-
""" Main loop for ActSim """
import sys
sys.path.append("build/")
import numpy as np
import scipy.sparse as ssp
import time
from argParse import ArgParser
#~ from graphClass import GraphClass
import libsimulator
#
#---
# Init modules
#--------------------
parser = ArgParser(description="AlgoGen: graph generator for reservoir computing",usage='%(prog)s [options]')
#
#---
# Main loop
#--------------------
if __name__ == "__main__":
None
#------------#
# Parse args #
#------------#
args = parser.parseArgs()
# get the xml trees
#------------------#
# Create the graph #
#------------------#
dicGraph = {"Type": "Erdos-Renyi",
"Nodes": 1000,
"Density": 0.01,
"FracInhib": 0.5,
"Weighted": True,
"Distribution": "Gaussian",
"Reciprocity": 0.2,
"InDeg": 2.5,
"OutDeg": 2.5,
"MeanExc": 1,
"MeanInhib": 1,
"VarExc": 0.2,
"VarInhib": 0.2}
#~ graph = GraphClass(dicGraph)
#~ nNodes = graph.getNodes()
nNodes = 1000
connectMat = ssp.rand(1000,1000,0.012,'csr')
csrData = [nNodes, connectMat.indptr.tolist(), connectMat.indices.tolist(), connectMat.data.tolist()]
#----------------------#
# Create the simulator #
#----------------------#
actSimulator = libsimulator.Simulator(csrData, parser.xmlRoot)
actSimulator.setParam()
start = time.time()
actSimulator.start()
print(time.time() - start)
#~ actSimulator = libsimulator.Simulator(csrData)