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

refactor: improve findstate2

parent 0412bcdf
No related branches found
No related tags found
1 merge request!3Full refactoring applying some conventions
Pipeline #9205 passed with stage
......@@ -10,7 +10,7 @@ void ModularSOG::setInitialState(ModularClassOfState *c) {
ModularClassOfState *ModularSOG::FindState(const ModularClassOfState *s) const {
for (auto *GONode : GONodes) {
bool arret = false;
for (size_t k = 0; ((k < (s->state).size()) && (!arret)); k++) {
for (auto k = 0; ((k < (s->state).size()) && (!arret)); k++) {
if ((s->state[k] == GONode->state[k]) == 0) {
arret = true;
}
......@@ -24,13 +24,13 @@ ModularClassOfState *ModularSOG::FindState(const ModularClassOfState *s) const {
return nullptr;
}
ModularClassOfState *ModularSOG::find2(const ModularClassOfState *c,
Set SRConcernes) const {
ModularClassOfState *ModularSOG::FindState2(const ModularClassOfState *c,
Set states_involved) const {
for (auto *GONode : GONodes) {
bool arret = false;
for (size_t k = 0; ((k < (c->state).size()) && (!arret)); k++) {
if (SRConcernes.find(k) != SRConcernes.end()) {
if (c->state[k] != GONode->state[k]) {
for (auto k = 0; ((k < (c->state).size()) && (!arret)); k++) {
if (states_involved.find(k) != states_involved.end()) {
if ((c->state[k] == GONode->state[k]) == 0) {
arret = true;
}
}
......
......@@ -37,7 +37,8 @@ class ModularSOG {
* Find a modular state
* @return
*/
ModularClassOfState *find2(const ModularClassOfState *, Set) const;
ModularClassOfState *FindState2(const ModularClassOfState *c,
Set states_involved) const;
void printsuccessors(ModularClassOfState *);
void InitVisit(ModularClassOfState *S, size_t nb);
......
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