Skip to content
Snippets Groups Projects
Commit 4a6aed5f authored by Jaime Arias's avatar Jaime Arias
Browse files

refactor: rename GONodes by states

parent b870bc84
No related branches found
No related tags found
No related merge requests found
......@@ -5,12 +5,12 @@
bdd *tab;
void SOG::set_initial_state(Aggregate *s) {
current_state = initial_state = s;
void SOG::set_initial_state(Aggregate *state) {
current_state = initial_state = state;
}
Aggregate *SOG::FindState(const Aggregate *s) const {
for (auto *GONode : GONodes) {
for (auto *GONode : states) {
if (s->state.id() == GONode->state.id()) {
return GONode;
}
......@@ -20,7 +20,7 @@ Aggregate *SOG::FindState(const Aggregate *s) const {
void SOG::InsertState(Aggregate *s) {
s->visited = false;
this->GONodes.push_back(s);
this->states.push_back(s);
nb_states++;
}
......@@ -46,7 +46,7 @@ void SOG::PrintCompleteInformation() {
std::cout << "\n\nGRAPH SIZE :";
std::cout << "\n\tNB MARKING : " << nb_marking;
std::cout << "\n\tNB NODES : " << nb_states;
std::cout << "\n\tNB ARCS : " << nb_arcs << "\n";
std::cout << "\n\tNB ARCS : " << nb_edges << "\n";
tab = new bdd[static_cast<int>(nb_states)];
......@@ -97,10 +97,10 @@ void SOG::GenerateReachabilityGraphDotfile(const std::string &filename) const {
return;
}
std::cout << "le graph contient : " << GONodes.size() << '\n';
std::cout << "le graph contient : " << states.size() << '\n';
file << "digraph reachab_graph {" << '\n';
for (const auto *GONode : GONodes) {
for (const auto *GONode : states) {
for (const auto &edge : GONode->successors) {
file << "ag_" << GONode->state.id() << " -> "
<< "ag_" << edge.first->state.id() << " [ label = \"t"
......@@ -147,5 +147,5 @@ void SOG::PrintPredecessors(const Aggregate *s) const {
}
void SOG::IncrementNbArcs() {
nb_arcs++;
nb_edges++;
}
......@@ -5,19 +5,49 @@
#include "aggregate.hpp"
// definition of types
typedef std::vector<Aggregate *> Aggregates;
class SOG {
public:
/**
* Constructor
*/
SOG() = default;
Aggregates GONodes;
/**
* Destructor
*/
~SOG() = default;
/**
* States of the graph
*/
Aggregates states;
/**
* Initial state of the graph
*/
Aggregate *initial_state{nullptr};
Aggregate *current_state{nullptr};
/**
* Number of states of the graph
*/
size_t nb_states{0};
/**
* Number of edges of the graph
*/
size_t nb_edges{0};
Aggregate *current_state{nullptr};
double nb_marking{0};
size_t nb_arcs{0};
/**
* Set the initial state of this graph
* @param state the initial state
*/
void set_initial_state(Aggregate *state);
/**
* Find a state
......@@ -65,12 +95,6 @@ class SOG {
*/
void InsertState(Aggregate *s);
/**
* Set the initial state of this graph
* @param s
*/
void set_initial_state(Aggregate *s);
/**
* Print the information of the graph
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment