Skip to content

Commit 2599ea4

Browse files
committed
fixes
1 parent 1752c28 commit 2599ea4

File tree

14 files changed

+126
-117
lines changed

14 files changed

+126
-117
lines changed

01 Tutorials/robot-marbles-part-3/robot-marbles-part-3.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
"name": "python",
291291
"nbconvert_exporter": "python",
292292
"pygments_lexer": "ipython3",
293-
"version": "3.6.5"
293+
"version": "3.7.0"
294294
}
295295
},
296296
"nbformat": 4,

01 Tutorials/videos/robot-marbles-part-1/cadCAD Template Robot and the Marbles.ipynb

Lines changed: 12 additions & 11 deletions
Large diffs are not rendered by default.

01 Tutorials/videos/robot-marbles-part-1/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
from datetime import timedelta
55
from cadCAD.configuration import append_configs
6-
from cadCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step, config_sim
6+
from cadCAD.configuration.utils import bound_norm_random, ep_time_step, config_sim
77

88
seeds = {
99
# 'z': np.random.RandomState(1),

01 Tutorials/videos/robot-marbles-part-1/config2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
from datetime import timedelta
55
from cadCAD.configuration import append_configs
6-
from cadCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step, config_sim
6+
from cadCAD.configuration.utils import bound_norm_random, ep_time_step, config_sim
77

88
seeds = {
99
# 'z': np.random.RandomState(1),

01 Tutorials/videos/robot-marbles-part-2/cadCAD Template Robot and the Marbles - part 2.ipynb

Lines changed: 36 additions & 36 deletions
Large diffs are not rendered by default.

01 Tutorials/videos/robot-marbles-part-2/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
from datetime import timedelta
55
from cadCAD.configuration import append_configs
6-
from cadCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step, config_sim
6+
from cadCAD.configuration.utils import bound_norm_random, ep_time_step, config_sim
77

88
seeds = {
99
# 'z': np.random.RandomState(1),

01 Tutorials/videos/robot-marbles-part-2/config2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
from datetime import timedelta
55
from cadCAD.configuration import append_configs
6-
from cadCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step, config_sim
6+
from cadCAD.configuration.utils import bound_norm_random, ep_time_step, config_sim
77

88
seeds = {
99
# 'z': np.random.RandomState(1),

01 Tutorials/videos/robot-marbles-part-2/configBlank.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
from datetime import timedelta
55
from cadCAD.configuration import append_configs
6-
from cadCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step, config_sim
6+
from cadCAD.configuration.utils import bound_norm_random, ep_time_step, config_sim
77

88
seeds = {
99
}

01 Tutorials/videos/robot-marbles-part-3/cadCAD Template Robot and the Marbles - part 3.ipynb

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

01 Tutorials/videos/robot-marbles-part-3/config.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
from datetime import timedelta
55
from cadCAD.configuration import append_configs
6-
from cadCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step, config_sim
6+
from cadCAD.configuration.utils import bound_norm_random, ep_time_step, config_sim
77

88
seeds = {
99
# 'z': np.random.RandomState(1),
@@ -36,16 +36,21 @@ def robot_arm(_g, step, sL, s):
3636

3737
robots_periods = [2,3] # Robot 1 acts once every 2 timesteps; Robot 2 acts once every 3 timesteps
3838

39+
def get_current_timestep(cur_substep, s):
40+
if cur_substep == 1:
41+
return s['timestep']+1
42+
return s['timestep']
43+
3944
def robot_arm_1(_g, step, sL, s):
4045
_robotId = 1
41-
if s['timestep']%robots_periods[_robotId-1]==0: # on timesteps that are multiple of 2, Robot 1 acts
46+
if get_current_timestep(step, s)%robots_periods[_robotId-1]==0: # on timesteps that are multiple of 2, Robot 1 acts
4247
return robot_arm(_g, step, sL, s)
4348
else:
4449
return({'add_to_A': 0, 'add_to_B': 0}) # for all other timesteps, Robot 1 doesn't interfere with the system
4550

4651
def robot_arm_2(_g, step, sL, s):
4752
_robotId = 2
48-
if s['timestep']%robots_periods[_robotId-1]==0: # on timesteps that are multiple of 3, Robot 2 acts
53+
if get_current_timestep(step, s)%robots_periods[_robotId-1]==0: # on timesteps that are multiple of 3, Robot 2 acts
4954
return robot_arm(_g, step, sL, s)
5055
else:
5156
return({'add_to_A': 0, 'add_to_B': 0}) # for all other timesteps, Robot 2 doesn't interfere with the system

0 commit comments

Comments
 (0)