agentsoz / bdi-abm-integration

BDI ABM Integration
GNU Lesser General Public License v3.0
8 stars 13 forks source link

Update BDI agent attributes #62

Closed osbornejr closed 6 years ago

osbornejr commented 6 years ago

A few more things need to be specified in the <person> <attributes>... section of the scenario_matsim_plans.xml.

Firstly, getProbHomeAfterDependents() and getProbHomeBeforeLeaving() should be exposed here, so that they can vary from person to person (and subgroup to subgroup).

Secondly, the EvacLocationPreference and InvacLocationPreference options should be able to hold a list of (possibly ranked) known evacuation/invacuation options. Further, there should be a separate EvacLocationInstructed field and perhaps even a FailedEvacLocations field. Will need to be introduced in conjunction with #58.

Lastly, the locations currently listed in the EvacLocationPreference and InvacLocationPreference fields have both a set of x-y coordinates and a name of the location (e.g. >TorquayForeshore,790771,5752462<). Ideally this format could be extended so that all x-y coordinates have this format (possibly alongside more information). In practice this will probably mean another person attribute for each activity in an agent's plan -- but this might be messy if they are attending multiple locations for the same activity?

Having this last feature would be useful to efficiently compute dependents location (#61) and will make the log file more readable. @dhixsingh

dhixsingh commented 6 years ago

Unfortunately there is no way to do that last one. A MATSim activity tag like this one <activity type="beach" x="794920.60169" y="5772690.71159" end_time="16:02:00" /> cannot have a description assigned to the type. The only way to say that beach is Anglesea Beach for intance, is via some attribute tag like beachDescription but that would not be a good idea as it would be easy to mess this up if one tag is updated and not the other.

dhixsingh commented 6 years ago

Parameters getProbHomeAfterDependents() and getProbHomeBeforeLeaving() are now exposed as of f8222a4. See below: https://github.com/agentsoz/bdi-abm-integration/blob/f8222a474ce91025a2c29880bd8d33ec2555fd35/examples/bushfire/scenarios/surf-coast-shire/population-subgroups-sample/scenario_matsim_plans.xml#L43-L44

@osbornejr you can now adjust these as needed for the hand-crafted test SurfCoastShirePopulationSubgroupsSampleTest.

osbornejr commented 6 years ago

Thanks. I am thinking with getProbHomeAfterDependents() and getProbHomeBeforeLeaving() that they should not be a probability for each agent, but a true/false condition which is determined during attribute assignment based on some overall probability for their subgroup type.

They could even be collapsed into one attribute WillGoHome, because the first one only applies to those with dependents, who do not have the later option of going home before leaving. Ultimately all agents will only use this variable once in their decision tree.

It would be good to avoid having any non-determined variables within the <attributes> field for an agent, and instead leave the probabilistic aspects to the global/subgroup level. Otherwise you have a random assignment of the variable to the agent, and another random choice when the agent has to apply that variable (a kind of double decision). It will make testing/validation more difficult down the track.

The only time it would be good is in cases where for a given agent, consistency is explicitly not desired. Is this the case the decision is only used once, so it should only be used once.

This is achievable now by just setting these variables to 1.0 or 0, but down the track I think it could be consolidated to one, deterministic attribute?

dhixsingh commented 6 years ago

Yes that is a much better scheme @osbornejr. Have now implemented what you suggested in db4cd19. Now looks like this: https://github.com/agentsoz/bdi-abm-integration/blob/db4cd19e4512fa4717cfe2892f37f348d98ff12d/examples/bushfire/scenarios/surf-coast-shire/population-subgroups-sample/scenario_matsim_plans.xml#L162-L163

dhixsingh commented 6 years ago

This issue was moved to agentsoz/ees#7