Skip to content

Discuss how to replace internal interface #208

@paulheinr

Description

@paulheinr

Currently, there is no such thing like the internal interface. Also, there are no additional engines (just activity and leg engine). From an ownership perspective this makes totally sense in Rust.

Instead of having an internal interface, the calling function (see rust_qsim/src/simulation/simulation.rs:64) plugs things together:

  1. It executes the activity engine, registers agents switching to leg engine
  2. It executes the leg engine stores all agents switching to activity engine
  3. loop

I.e., agents' activity start will be registered one time step after they ended their leg. This is "just" one time step, but if we (1) increase time step size or (2) the agent has a lot of activities, this might get a problem.

The extreme case is, that an agent has interaction activities with dur=0 and teleported legs in between with trav_time=0. In this case, all the events should have the same time stamp.

I think a possible solution in the current setting is, that we split do_sim_step and receive_agent in the engines and introduce a loop in the outer do_sim_step. The outer function is still responsible for agents switching state, but first it would call do_sim_step and then it would loop over receive_agent. The later returns such agents as described above, who immediately exit the engine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions