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

DEVS/simulator: Use Model time #2248

Closed
wants to merge 1 commit into from
Closed

DEVS/simulator: Use Model time #2248

wants to merge 1 commit into from

Conversation

EwoutH
Copy link
Member

@EwoutH EwoutH commented Aug 26, 2024

This PR is not intended to (ever) be merged, but to spark discussion about how the simulator could integrate with timekeeping in the model.

The main point that I want to discuss is that now that we are moving away from schedulers, and thus moving away from schedulers.time, I don't to move time away from the model again (in this case to simulator.time), where a datacollector or visualisation module is unable to find it.

I think it would be logical if the simulator would update the model time. If one is used, the model time should also be increased on a step or otherwise, unless explicitly stated.

The reason this is a PR and not a discussion is that this way we can also see and discuss potential code issues.

@@ -164,7 +157,7 @@ def schedule_event_relative(

"""
event = SimulationEvent(
self.time + time_delta,
self.model._time + time_delta,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps betraying my java background, but changing attributes of other objects directly like this makes me uncomfortable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that. I think in this case it allows the model to be the ground truth of time. We should document it as "A DEVS simulator is an alternative way to manage agent activation and progress time".

@EwoutH
Copy link
Member Author

EwoutH commented Aug 27, 2024

Closing this, since it was just a conceptual PR to start thinking about this.

@quaquel I would support a property that copies simulator time, if that makes implementation significantly more elegant. I'm also good with the simulator not keeping it's time at all (or keep it private in like _time), to keep the focus on model.time.

@EwoutH EwoutH closed this Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants