Skip to content

Commit

Permalink
Update App to call right num peds
Browse files Browse the repository at this point in the history
  • Loading branch information
chraibi committed Oct 22, 2024
1 parent e39989f commit 0f32170
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def get_agent_positions(_data: Dict[str, Any]) -> Tuple[List[Point], int]:
num_agents = parse_number_agents(_data)
logging.info(f"Generating {num_agents} agent positions")
positions = init_positions(_data, num_agents)

return positions, num_agents


Expand Down Expand Up @@ -549,4 +549,3 @@ def main(

if __name__ == "__main__":
typer.run(main)

5 changes: 3 additions & 2 deletions src/simutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
parse_simulation_time,
parse_time_step,
)
from simulation import get_agent_positions


def extract_motivation_parameters(data: Dict[str, Any]) -> Dict[str, Any]:
Expand Down Expand Up @@ -68,17 +69,17 @@ def call_simulation(config_file: str, output_file: str, data: Dict[str, Any]) ->
with open(config_file, "r", encoding="utf8") as f:
data = json.loads(f.read())

_, number_agents = get_agent_positions(data)
fps = parse_fps(data)
time_step = parse_time_step(data)
number_agents = parse_number_agents(data)
simulation_time = parse_simulation_time(data)
strategy = parse_motivation_strategy(data)

msg.code(f"Running simulation with {number_agents}. Strategy: <{strategy}>...")

with st.spinner("Simulating..."):
evac_time = init_and_run_simulation(
number_agents, fps, time_step, simulation_time, data, Path(output_file), msg
fps, time_step, simulation_time, data, Path(output_file), msg
)

msg.code(f"Finished simulation. Evac time {evac_time:.2f} s")
Expand Down

0 comments on commit 0f32170

Please sign in to comment.