MengeCrowdSim / Menge

The source code for the Menge crowd simulation framework
Apache License 2.0
138 stars 64 forks source link

Agent resize doesn't work with non-circular geometry #48

Open MengeCrowdSim opened 7 years ago

MengeCrowdSim commented 7 years ago

As exposed in #47, the Action for resizing agents does not work with the elliptical GCF agents.

We need to introduce an interface that can account for arbitrary geometries that can be scaled and offset and appropriately restored.

Design idea

Give agents a "size" member. This is a virtual class: AgentSize. It can clone itself into a an instance that can be stored indpendently of the Agent. It supports operations such as scale and offset. It also supports "resetting" from another instance (e.g., the one that was cached.) The AgentProperty action will request the agent's size (at which point, it receives a clone of the original size). The AgentProperty owns this instance and will destroy it when it is finished with the agent (optionally resetting the agent size by passing the cached size object back.)

This might also have to address the concept of "radius" as a BaseAgent property. Perhaps it would be better as "size" or "scale", and have each agent type interpret size to mean something specific.