Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix the function naming consistency issue: dynamic vs dynamics #43

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

shengjiex98
Copy link
Contributor

Problem description

I've noticed the naming of the dynamics functions are inconsistent from file to file. For example, dynamic() in base_agent.py,

@staticmethod
def dynamic(t, state, u):
raise NotImplementedError()

vs dynamics() in example_agent/ball_agent.py:

def dynamics(self, t, state):
"""Defines the RHS of the ODE used to simulate trajectories"""
x, y, vx, vy = state
x_dot = vx
y_dot = vy
vx_dot = 0
vy_dot = 0
return [x_dot, y_dot, vx_dot, vy_dot]

This also applies to a number of multi-dynamics agents:

@staticmethod
def dynamic_heat(t, state):
x = state
x_dot = 40-0.5*x
return [x_dot]
@staticmethod
def dynamic_cool(t, state):
x = state
x_dot = 30-0.5*x
return [x_dot]

Changes and tests

Since "dynamics" seem to be the more appropriate term, I've changed all references of dynamic that I could find to dynamics, including multi-dyanmics agents (i.e., dynamic_heat -> dynamics_heat. I rantests/test_verse.py and it passed without issues.

Happy to discuss further in case I missed anything :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants