epymorph.log.movement
Capturing extremely detailed movement data from a simulation, which can be useful for debugging movement models.
MovementData
Bases: Protocol
Container for collected simulation movement data. Run the simulation inside a
movement_data
context and an instance of this class will be returned. After
the simulation has completed, you can use this object to retrieve movement data
either by clause or in aggregate across all clauses.
A note about axis ordering: both requested
and actual
data are NxN in shape,
where N is the number of geo nodes in the simulation. We use the convention that
the first axis represents where the movement is "from" and the second axis
represents where the movement is "to". Movement due to the return clause is treated
the same way: returning from work to home for example is recorded as (work, home).
requested_by
abstractmethod
actual_by
abstractmethod
requested_all
abstractmethod
movement_data
movement_data() -> Generator[MovementData, None, None]
Run one simulation in this context manager in order to capture
detailed movement data. This returns a MovementData
object which
can be used -- after the context exits -- to retrieve the movement data.
Yields:
-
MovementData
–The object that will contain the collected movement data.
Examples: