Ticket #88 (new task)

Opened 10 months ago

Last modified 9 months ago

don't write into configuration after starting a simulation

Reported by: borning Owned by: cuspa
Priority: normal Milestone:
Component: Opus/UrbanSim (general) Version:
Keywords: Cc:

Description (last modified by borning) (diff)

The configuration object (also sometimes called 'resources') is a subclass of dictionary. Good practice would be to set up the configuration, start the simulation, and not change it while the simulation is running. There are a few places that do change it. We should eliminate those.

Specifically, in urbansim.model_coordinators.model_system, the run_multiprocess method changes the 'years' and 'seed' entries, and then forks a new process with the edited config. This can lead to bugs, though, because you can't count on the years field being correct after that. To fix this, we should either make years and seed be command line arguments, or make a copy of the configuration to pass along.

Besides that file, there are other places that change resources['cache_directory'] -- search for those. One place in particular is in opus_core/services/run_server/run_manager.py - the history_id gets added to the cache directory name.

Change History

Changed 9 months ago by borning

We should also add this to the coding guidelines in the manual.

Changed 9 months ago by borning

  • description modified (diff)
Note: See TracTickets for help on using tickets.