Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exportMatrix method #133

Merged
merged 23 commits into from
Feb 27, 2024
Merged

Add exportMatrix method #133

merged 23 commits into from
Feb 27, 2024

Conversation

Grufoony
Copy link
Collaborator

@Grufoony Grufoony commented Feb 19, 2024

In this PR:

  • Add exportMatrix method to Graph class. Default (and only by now) format is the dsm one.
  • Fix bug from streetMeanSpeed

Grufoony and others added 11 commits February 19, 2024 11:59
* Define `is_agent` and `is_itinerary` type traits

* Add draft of dynamic class

* Updated docs

* Updated docs

* add `rng` and `seed`

* init dynamics testing

* add TODO functions

* compiling

* Update old namespaces

* Use unique pointers instead of shared for members of dynamic class

* Add method for removing agents from dynamics

* Fix declaration of template constraints

* Add methods for setting/adding agents and itineraries using generic span

* Fix docstrings and comments

* Formatting

* Draft of first and second order dynamics

* Add setMinSpeedRateo function to Dynamics class
and setAgentSpeed function to FirstOrderDynamics
class

* Add Delay template parameter to Agent class and
enqueue function in Street class

* Refactor Street class templates to improve
readability and maintainability.

* Refactor Agent and Street classes by removing
Delay template parameter

* Add support for Delay parameter in Agent template

* Add template params

* Refactor addItineraries and setAgentSpeed
functions

* Update Dynamics class to use FirstOrderDynamics
and add third template parameter

* Add constructor to FirstOrderDynamics class

* Refactor Dynamics constructor

* Merge branch 'main' into feature_dynamic_class

* Implement addRandomAgents and addItineraries
functions in Dynamics class

* Add test case for adding random agents with many
itineraries

* Add error probability and move agent functionality

* Add template function to update paths in Dynamics
class

* Uniformed tests like in the main

* Add `meanSpeed` function

* Add meanDensity() and meanFlow() functions to
Dynamics class

* Add meanTravelTime() function to Dynamics class

* Implement evolve function in Dynamics.hpp

* Implement setAgentSpeed function in Dynamics.hpp

* Implement agent movement and update dynamics

* Implement setAgentSpeed function and updatePaths
function

* Fix delay comparison in FirstOrderDynamics

* Update evolve function parameter name

* add street getter

* Add check for street existence in graph

* Commented out error handling in
Itinerary::setPath()

* Implement path update in Dynamics

* draft of rework moveAgent

* first evolve draft

* SIGSEGV

* no seg fault

* Fix agent movement in FirstOrderDynamics

* segmentation fault c:

* Add missing include and fix typo in Dynamics.hpp

* working evolve

* draftino pazzo sgravato

* niceeeeeeeeeeeeeeeeeeee

* add Subcase for reinsertion

* formatting

* Fix importAdj method call in Test_dynamics.cpp

* Add Dynamics header file

* Fix agent speed calculation and add debug output for no possible moves

* Remove unnecessary print statement in Dynamics.hpp

* Fix agent delay calculation in Dynamics.hpp

* Found bug in `shortestPath`

* Fix search of shortest paths which was skipping some nodes

* Fix reconstruction of dijkstra path and distance

* bugfix in `updatePaths()`

* Remove commented out code in Test_dynamics.cpp

* speed at intersections

* Fix type conversion in meanSpeed function

* add `-fsanitize=address` flag to detect memory leaks

* commented memory leaky tests

* Fix deletion of agent in Dynamics.hpp

* do not f*** with shared pointers

* Add optional uniform distribution for adding random agents

* Refactor addRandomAgents function in Dynamics.hpp

* Refactor agent variable declaration in Dynamics.hpp

* Fix agent ID bug and improve street handling

* changed street enqueuing

* Refactor enqueue and dequeue methods in Street class

* bugfixing

* bugfix

* Refactor agent addition and movement in Dynamics class

* Refactor Dynamics class constructor and member functions

* unique ptr

* Refactor removeAgent function and remove commented code

* fix ?

* Remove redundant code for reinserting agents at their destination

* Add optional parameter to getRow and getCol functions

* splitted evolve funcion and revised Dynamics structure

* Add m_evolveNodes function to Dynamics.hpp

* updated docs

* virtualization

* initial draft

* Add setPhase() function to TrafficLight class

* Implement setStreetPair method in TrafficLight class

* Add isGreen() method to TrafficLight class

* Fix traffic light counter reset bug

* Add test on TrafficLight

* clang-format

* Fix Doxygen comments in Node.hpp

* Fix return value formatting in Node class documentation

* Fix template constraint declarations

* Add comment

* Refactor Dijkstra algorithm implementation in Graph.hpp

* Remove unused docs fodler

* Merge

* Merge branch 'remove_docs_folder' into feature_add_semaphores

* Add TrafficLight class and update Dynamics behavior

* Refactor TrafficLight casting in Dynamics.hpp

* Add new functions and modify existing functions in Node.hpp

* Refactor Node class and add new features

* Add test case for asymmetric traffic light

* removed docs folder

* fix

* workind trafficlight dynamics

* Add agentCounter to Node class

* Refactor traffic light logic in Dynamics.hpp

* tested evolve with trafficLights

* optimez updatePaths

* Rework Street class

* Adjusted tests

* comments

* temporary fix to duplicates

* refactor constants

* add draft of new evolve... not so easy

* draft nella draft

* restored model

* fix nan variance in `meanSpeed()`

* Add `angle` member in Street class #118

* Add idea for street priorities

* not working

* working

* working

* Remove unnecessary code in Dynamics.hpp

* Add comment

* Update doctest version to 2.4.11

* Fix merge commit

* Change double key into int16_t

* new `updatePaths()` test case - see #126

* Close #126. Reopen #94.

* Add `distance` variable to Agent class

* Add test for agent `distance`:
- update Agent class;
- update c++ standard to 23 for std::fmod

* Update C++ version

* Remove useless check

* Bugfix

* Add constructor to build a street with same params but different id

* Add `m_reassignIds()` function. Fix #129

* Fix benchmarks

* Update docstrings

* Small change into `m_evolveNodes`

* Rework street priority logic in Node

* Add override keyword

* Fix street priority ids

* Fix requires brackets

* Fix brakets

* Fix brakets

* Go back to C++20

* Formatting

* Update project version in CMake file

* Correct template type of `agentId`

---------

Co-authored-by: sbaldu <simone.balducci00@gmail.com>
Co-authored-by: Simone Balducci <93096843+sbaldu@users.noreply.github.com>
@Grufoony Grufoony added test Regarding the tests of the code addition labels Feb 19, 2024
@Grufoony Grufoony requested a review from sbaldu February 19, 2024 20:01
@Grufoony Grufoony self-assigned this Feb 19, 2024
@Grufoony
Copy link
Collaborator Author

Requires #132

@Grufoony
Copy link
Collaborator Author

Maybe this is a little bugged... I'm investigating

@sbaldu sbaldu merged commit 7357b46 into main Feb 27, 2024
18 of 21 checks passed
@Grufoony Grufoony deleted the feature_add_matrix_export branch March 4, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Regarding the tests of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants