Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds initial support for Areas in UXsim. I approached it in the following way:
area
attribute in theNode
class to define the area a node belongs to.__init__
method of theNode
class to accept an optionalarea
parameter.W.NODES_AREA_DICT
to store nodes grouped by their respective areas.update_nodes_area_dict()
to populate the area dictionary with nodes.get_random_node_in_area()
to retrieve a random node within a specified area.finalize_scenario()
to callupdate_nodes_area_dict()
ensuring the area dictionary is up to date.In my model, I use it like this:
When adding the nodes to the model, I define the
area
keywordWhen planning trips, I ask to get a random node from an area, which I use as starting point.
More features could be added. But before I develop this further, I would like to know @toruseo if this is a desired development direction.
I could also understand that you want to approach this subject differently, by making Areas objects or by tracking areas in a different way.
Part of #102.