Skip to content

Commit

Permalink
format notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
chraibi committed Jan 22, 2025
1 parent 297eba0 commit 930831b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions notebooks/model-comparison.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,13 @@
" journey = jps.JourneyDescription(exit_ids)\n",
" journey_id = simulation.add_journey(journey)\n",
" centroids = [polygon.centroid.coords[0] for polygon in goals]\n",
" orientations = [np.array(centroid) - np.array(position) for centroid, position in zip(centroids, positions)]\n",
" for pos, v0, exit_id, orientation in zip(positions, speeds, exit_ids, orientations):\n",
" orientations = [\n",
" np.array(centroid) - np.array(position)\n",
" for centroid, position in zip(centroids, positions)\n",
" ]\n",
" for pos, v0, exit_id, orientation in zip(\n",
" positions, speeds, exit_ids, orientations\n",
" ):\n",
" if agent_parameters == jps.AnticipationVelocityModelAgentParameters:\n",
" simulation.add_agent(\n",
" agent_parameters(\n",
Expand All @@ -144,19 +149,22 @@
" stage_id=exit_id,\n",
" desiredSpeed=v0,\n",
" position=pos,\n",
" orientation=orientation\n",
" orientation=orientation,\n",
" )\n",
" )\n",
" elif agent_parameters == jps.GeneralizedCentrifugalForceModelAgentParameters:\n",
" elif (\n",
" agent_parameters\n",
" == jps.GeneralizedCentrifugalForceModelAgentParameters\n",
" ):\n",
" simulation.add_agent(\n",
" agent_parameters(\n",
" journey_id=journey_id,\n",
" stage_id=exit_id,\n",
" v0=v0,\n",
" position=pos,\n",
" orientation=orientation\n",
" orientation=orientation,\n",
" )\n",
" ) \n",
" )\n",
" else:\n",
" simulation.add_agent(\n",
" agent_parameters(\n",
Expand Down

0 comments on commit 930831b

Please sign in to comment.