Skip to content

Commit

Permalink
small change on examples
Browse files Browse the repository at this point in the history
  • Loading branch information
younger committed Mar 26, 2024
1 parent e2d501f commit 889a41f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions demo/dryvr_demo/dryvr_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, id, code = None, file_name = None):
self.static_parameters = None
self.uncertain_parameters = None

def dynamics(self, x, t):
def dynamics(self, t, x):
x1, x2, x3,\
x4, x5, x6,\
x7 = x
Expand All @@ -42,7 +42,7 @@ def __init__(self, id, code = None, file_name = None):
self.static_parameters = None
self.uncertain_parameters = None

def dynamics(self, x, t):
def dynamics(self, t, x):
x1, x2, x3,\
x4, x5, x6,\
x7, x8, x9,\
Expand Down
2 changes: 1 addition & 1 deletion demo/dryvr_demo/vanderpol_demo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AgentMode(Enum):
tuple([AgentMode.Default]),
],
)
scenario.config.reachability_method = "NeuReach"
# scenario.config.reachability_method = "NeuReach"
traces = scenario.verify(
7,
0.05,
Expand Down
2 changes: 1 addition & 1 deletion verse/agents/base_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def TC_simulate(self, mode, initialSet, time_horizon, time_step, map=None):
"""
y0 = initialSet
t = np.round(np.arange(0.0, time_horizon+time_step/2, time_step), 8)
trace = odeint(func = self.dynamics, y0 = y0, t = t)
trace = odeint(func = self.dynamics, y0 = y0, t = t, tfirst=True)
t = t.reshape((-1,1))
trace = np.hstack((t, trace))
return trace
3 changes: 1 addition & 2 deletions verse/agents/example_agent/ball_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ def __init__(self, id, code=None, file_name=None):
# Calling the constructor of tha base class
super().__init__(id, code, file_name)

@staticmethod
def dynamic(t, state):
def dynamics(self, t, state):
"""Defines the RHS of the ODE used to simulate trajectories"""
x, y, vx, vy = state
x_dot = vx
Expand Down

0 comments on commit 889a41f

Please sign in to comment.