File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,13 @@ Import libraries:
32
32
33
33
Instantiate brical.NetworkBuilder.
34
34
35
- >>>> nb=brical.NetworkBuilder()
35
+ >>> nb=brical.NetworkBuilder()
36
36
37
37
Load JSON files:
38
38
39
39
In this example, you load six files from 'test/n001' directory.
40
40
41
- >>>> f = open("[YOUR GIT DIRECTORY]/brical/test/n001/01InputComponent.json")
41
+ >>> f = open("[YOUR GIT DIRECTORY]/brical/test/n001/01InputComponent.json")
42
42
>>> nb.load_file(f)
43
43
True
44
44
>>> f = open("[YOUR GIT DIRECTORY]/brical/test/n001/02MainComponent.json")
@@ -76,11 +76,11 @@ BriCA modules are accessed via the module dictionary obtained with agent_builder
76
76
Setting non-zero values to the input module:
77
77
78
78
>>> v = np.array([1, 2, 3], dtype=np.int16)
79
- >>> modules["BriCA1.InputModule"].get_component("BriCA1.InputModule"). set_state("InputModulePort", v)
79
+ >>> modules["BriCA1.InputModule"].set_state("InputModulePort", v)
80
80
81
81
Setting a map for PipeComponent (see BriCA1 tutorial for explanation):
82
82
83
- >>>> modules["BriCA1.MainModule"].get_component("BriCA1.MainModule") .set_map("Port1", "Port2")
83
+ >>> modules["BriCA1.MainModule"].set_map("Port1", "Port2")
84
84
85
85
Now run the network step by step and see if values are transmitted to the ports:
86
86
Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ def print_network(network):
46
46
47
47
agent_builder = brical .AgentBuilder ()
48
48
agent = agent_builder .create_agent (network_builder )
49
- scheduler = brica1 .VirtualTimeSyncScheduler (agent )
50
49
if agent == agent_builder .INCONSISTENT :
51
50
sys .stderr .write ("ERROR: INCONSISTENT!\n " )
52
51
elif agent == agent_builder .NOT_GROUNDED :
@@ -67,7 +66,7 @@ def print_network(network):
67
66
impl = v ["ImplClass" ]
68
67
if impl == "" :
69
68
continue
70
- component = modules [module ]. get_component ( module )
69
+ component = modules [module ]
71
70
ports = v ["Ports" ]
72
71
buffers .append ([module , component , ports ])
73
72
if "InputModule" in module : # Setting of initial data
@@ -98,6 +97,7 @@ def print_network(network):
98
97
99
98
# Run
100
99
print ("--- Run ---" )
100
+ scheduler = brica1 .VirtualTimeSyncScheduler (agent )
101
101
for i in range (len (buffers )):
102
102
print (scheduler .step ())
103
103
for b in buffers :
Original file line number Diff line number Diff line change 3
3
"Type" : " C" ,
4
4
"Name" : " InputComponent" ,
5
5
"Base" : " BriCA1" ,
6
- "Comment" : " 正常系:サンプルデータが正常に動作することを確認 "
6
+ "Comment" : " Normal case: to confirm BriCAL works with test case n001 "
7
7
},
8
8
9
9
"Modules" : [{
You can’t perform that action at this time.
0 commit comments