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

Warn user if step_target is not set correctly or separate it from final time step #51

Open
SarahAlidoost opened this issue Jan 22, 2024 · 0 comments

Comments

@SarahAlidoost
Copy link
Member

The model.run() runs while self.step_count < self.step_target. Imagine, step_target=100 but we want only to run 10 time steps. Currently, this is possible if before model.run() , the variable step_target is set to a smaller value. e.g. the cod below is working:

model = dgl_ptm.PovertyTrapModel(model_identifier='test2')
model.set_model_parameters()  # Default step_target is 100
model.initialize_model()
model.step_target = 10
model.run()

The variable step_target is used in _initialize_model_theta to calculate the array of modelTheta. Before performing run(), If step_target is changed to a value greater than was used initially in _initialize_model_theta e.g. step_target=200, the model run fails. e.g. the code below is not working:

model = dgl_ptm.PovertyTrapModel(model_identifier='test2')
model.set_model_parameters()  # Default step_target is 100
model.initialize_model()
model.step_target = 200
model.run()
@SarahAlidoost SarahAlidoost changed the title Warn user if step_target is not set correctly Warn user if step_target is not set correctly or separate it from final time step Jan 22, 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

No branches or pull requests

1 participant