Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
FIC_DK_P GA Solving
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
M3TAL
FIC_DK_P GA Solving
Commits
557f6071
Commit
557f6071
authored
Dec 02, 2020
by
Alexis Lebis
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix stagnation value for prereq
parent
4cc8a0e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
16 deletions
+68
-16
prerequisitesConstraints.cpp
src/model/constraints/prerequisitesConstraints.cpp
+68
-16
No files found.
src/model/constraints/prerequisitesConstraints.cpp
View file @
557f6071
...
...
@@ -272,17 +272,14 @@ std::pair<bool, double> ConstraintsPrerequisites::integrityCheck(Cursus indiv)
if
(
delta
==
0
)
//if 0 -->comp not mobilized here, thus stagnation therefore decay for the jth comp
{
decayClock
.
at
(
j
)
++
;
}
else
{
if
(
decayClock
.
at
(
j
)
>
0
)
//if there is decay
{
decayVal
=
DecayEngine
::
defaultDecay
(
decayClock
.
at
(
j
));
//we take the diff between decay(j) and decay(j-1) since for each stagnation we instantly repercut the decay
decayVal
=
DecayEngine
::
defaultDecay
(
decayClock
.
at
(
j
))
-
DecayEngine
::
defaultDecay
(
decayClock
.
at
(
j
)
-
1
);
decaynb
++
;
}
//delta = compDistribyTF.at(i).at(j) - compDistribyTF.at(i-1).at(j);
decayed
=
compDistribyTF
.
at
(
i
-
1
).
at
(
j
)
-
decayVal
;
if
(
decayed
<
0
)
...
...
@@ -301,8 +298,37 @@ std::pair<bool, double> ConstraintsPrerequisites::integrityCheck(Cursus indiv)
compDistribyTF
.
at
(
k
).
at
(
j
)
=
0
;
}
}
}
else
{
// if(decayClock.at(j)>0) //if there is decay
// {
// decayVal = DecayEngine::defaultDecay(decayClock.at(j));
// decaynb++;
// }
// //delta = compDistribyTF.at(i).at(j) - compDistribyTF.at(i-1).at(j);
// decayed = compDistribyTF.at(i-1).at(j) - decayVal;
// if(decayed < 0)
// decayed = 0;
// compDistribyTF.at(i).at(j) = delta + decayed;
// // affecting the decay to this comp in upper TFs
// if(decayed > 0)
// {
// for(int k = i+1 ; k < compDistribyTF.size(); k++)
// {
// compDistribyTF.at(k).at(j) -= decayVal;
// if(compDistribyTF.at(k).at(j) < 0)
// compDistribyTF.at(k).at(j) = 0;
// }
// }
decayClock
.
at
(
j
)
=
0
;
decayClock
.
at
(
j
)
=
0
;
//we just reset the decay counter since we found the comp at j
}
}
}
...
...
@@ -473,17 +499,14 @@ std::pair<bool, double> res;
if
(
delta
==
0
)
//if 0 -->comp not mobilized here, thus stagnation therefore decay for the jth comp
{
decayClock
.
at
(
j
)
++
;
}
else
{
if
(
decayClock
.
at
(
j
)
>
0
)
//if there is decay
{
decayVal
=
DecayEngine
::
defaultDecay
(
decayClock
.
at
(
j
));
//we take the diff between decay(j) and decay(j-1) since for each stagnation we instantly repercut the decay
decayVal
=
DecayEngine
::
defaultDecay
(
decayClock
.
at
(
j
))
-
DecayEngine
::
defaultDecay
(
decayClock
.
at
(
j
)
-
1
);
decaynb
++
;
}
//delta = compDistribyTF.at(i).at(j) - compDistribyTF.at(i-1).at(j);
decayed
=
compDistribyTF
.
at
(
i
-
1
).
at
(
j
)
-
decayVal
;
if
(
decayed
<
0
)
...
...
@@ -502,8 +525,37 @@ std::pair<bool, double> res;
compDistribyTF
.
at
(
k
).
at
(
j
)
=
0
;
}
}
}
else
{
// if(decayClock.at(j)>0) //if there is decay
// {
// decayVal = DecayEngine::defaultDecay(decayClock.at(j));
// decaynb++;
// }
// //delta = compDistribyTF.at(i).at(j) - compDistribyTF.at(i-1).at(j);
// decayed = compDistribyTF.at(i-1).at(j) - decayVal;
// if(decayed < 0)
// decayed = 0;
// compDistribyTF.at(i).at(j) = delta + decayed;
// // affecting the decay to this comp in upper TFs
// if(decayed > 0)
// {
// for(int k = i+1 ; k < compDistribyTF.size(); k++)
// {
// compDistribyTF.at(k).at(j) -= decayVal;
// if(compDistribyTF.at(k).at(j) < 0)
// compDistribyTF.at(k).at(j) = 0;
// }
// }
decayClock
.
at
(
j
)
=
0
;
decayClock
.
at
(
j
)
=
0
;
//we just reset the decay counter since we found the comp at j
}
}
}
...
...
Alexis Lebis
@alexis.lebis
mentioned in issue
#24 (closed)
·
Dec 02, 2020
mentioned in issue
#24 (closed)
mentioned in issue #24
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment