-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Labels
class::bugBugs found in the softwareBugs found in the softwareloc::backendThis issue concerns the C++ backend implementation.This issue concerns the C++ backend implementation.model::abmThis issue concerns any kind of agent-based model.This issue concerns any kind of agent-based model.
Description
Bug description
When copying the world of the ABM, persons are copied in order of appearance in the locations. That means that person IDs change but the order of the person vector may change. Since trips are accessed via
auto& person = m_persons[trip.person_id];
this is an issue and leads to an error.
This can be either resolved by keeping the order of the persons during a copy operation on the world OR by accessing people not with array indices but only by their unique person ID.
Version
Mac
To reproduce
Go to branch abm_paper_test_bs.
Use the code
// Create the sampled simulation with start time t0.
auto world = mio::abm::World(num_age_groups);
create_sampled_world(world, input_dir, t0, max_num_persons);
auto world_copy = world;
// auto world_copy = world; // COPY CONSTRUCTOR DOESN'T WORK. LOCATIONS AREN'T ASSIGNED!
auto sim = mio::abm::Simulation(t0, std::move(world_copy));
in lines 897 ff.
Relevant log output
Assertion failed: (index != INVALID_LOCATION_INDEX && "unexpected error."), function find_location, file world.cpp, line 191.Add any relevant information, e.g. used compiler, screenshots.
No response
Checklist
- Attached labels, especially loc:: or model:: labels.
- Linked to project
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
class::bugBugs found in the softwareBugs found in the softwareloc::backendThis issue concerns the C++ backend implementation.This issue concerns the C++ backend implementation.model::abmThis issue concerns any kind of agent-based model.This issue concerns any kind of agent-based model.
Type
Projects
Status
Done (Total) 💯