Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

State Recording #42

Open
2 tasks
SeanMcOwen opened this issue Jul 4, 2024 · 1 comment
Open
2 tasks

State Recording #42

SeanMcOwen opened this issue Jul 4, 2024 · 1 comment
Labels

Comments

@SeanMcOwen
Copy link
Collaborator

SeanMcOwen commented Jul 4, 2024

From DIPR:

The simulation records the state of the system at each time step, capturing metrics such as completed rides, total distance traveled, and total cost.
These metrics are used to evaluate the performance of the system and compare different routing strategies.

Notes from Sean:

  • I have a few implementations of logging I can show that might be helpful
  • Also a feature I have added in the past is a DEBUG_MODE parameter for logging the entire state after blocks
  • But for larger simulations only saving the history of important metrics and variables will be a much better way to go, otherwise storage blows up
  • Metrics can be possibly handled post simulation with the metric functions feature of simulation running

Tasks:

@SeanMcOwen SeanMcOwen added the DIPR label Jul 4, 2024
@SeanMcOwen
Copy link
Collaborator Author

Also some code:

def record_state(self, current_time):
    completed_rides = len(self.completed_rides)
    total_distance = sum([ride.metadata['distance_km'] for ride in self.completed_rides])
    total_cost = sum([ride.metadata['cost_usd'] for ride in self.completed_rides])
    self.state_map.record_state(current_time, completed_rides, total_distance, total_cost)

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

No branches or pull requests

1 participant