Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MH-Builder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
orkad-public
MH-Builder
Commits
ec05d10e
Commit
ec05d10e
authored
8 months ago
by
Caron Olivier
Browse files
Options
Downloads
Patches
Plain Diff
bug correction
parent
0c3fb47b
No related branches found
No related tags found
No related merge requests found
Pipeline
#4740
failed
8 months ago
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src-bin/adaptive_fsp.cpp
+2
-2
2 additions, 2 deletions
src-bin/adaptive_fsp.cpp
src/core/adaptive/ChangeIfSlowImprovement.h
+1
-1
1 addition, 1 deletion
src/core/adaptive/ChangeIfSlowImprovement.h
src/core/adaptive/TimeWindow.h
+1
-1
1 addition, 1 deletion
src/core/adaptive/TimeWindow.h
with
4 additions
and
4 deletions
src-bin/adaptive_fsp.cpp
+
2
−
2
View file @
ec05d10e
...
...
@@ -197,7 +197,7 @@ int main(void) {
std
::
vector
<
std
::
function
<
void
(
opt
::
singleSolution
::
localsearch
::
SimulatedAnnealing
<
SOL
>&
)
>>
vec_functions2
=
{
setToSwap
,
setToShift
};
// Step 4, encapsulation of the algorithm to the adaptive time windows
core
::
adaptive
::
ChangeIfSlowImprovement
<
SOL
,
opt
::
singleSolution
::
localsearch
::
SimulatedAnnealing
<
SOL
>
>
adaptive
Window
(
*
sa
,
vec_functions2
,
4
,
0.02
,
10
,
eval
);
core
::
adaptive
::
ChangeIfSlowImprovement
<
SOL
,
opt
::
singleSolution
::
localsearch
::
SimulatedAnnealing
<
SOL
>
>
adaptive
_sa
(
*
sa
,
vec_functions2
,
4
,
0.02
,
10
,
eval
);
std
::
cout
<<
"using ChangeIfSlowImprovementWindow strategy during "
<<
vec_functions
.
size
()
*
criterion_length
<<
std
::
endl
;
std
::
cout
<<
"every 4 seconds, alternate the neighbor operators: swap and shift if the fitness improves less than 0.02 %"
<<
std
::
endl
;
std
::
cout
<<
"repeat 10 times, so 40 seconds for the complete run "
<<
std
::
endl
;
...
...
@@ -206,7 +206,7 @@ int main(void) {
std
::
cout
<<
sol3
<<
std
::
endl
;
adaptive
Window
(
sol3
);
adaptive
_sa
(
sol3
);
std
::
cout
<<
"FINAL SOLUTION"
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/core/adaptive/ChangeIfSlowImprovement.h
+
1
−
1
View file @
ec05d10e
...
...
@@ -65,7 +65,7 @@ namespace core::adaptive {
// init phase
auto
fitness_scalar_value
=
_in
.
fitness
().
scalar
()
;
int
counter
=
1
;
int
select_function
=
0
;
criterion
::
TimeCriterion
<
IN
>
timeCriterion
(
duration
*
1000
);
opt
::
criterion
::
TimeCriterion
<
IN
>
timeCriterion
(
duration
*
1000
);
timeCriterion
.
init
();
// perform algorithm with the specific adaptive strategy
while
(
counter
<=
this
->
max_iterations
)
{
...
...
This diff is collapsed.
Click to expand it.
src/core/adaptive/TimeWindow.h
+
1
−
1
View file @
ec05d10e
...
...
@@ -61,7 +61,7 @@ namespace core::adaptive {
*/
void
operator
()(
IN
&
_in
)
override
{
for
(
unsigned
long
long
int
i
=
0
;
i
<
this
->
durations
.
size
();
i
++
)
{
criterion
::
TimeCriterion
<
IN
>
timeCriterion
(
this
->
durations
[
i
]);
opt
::
criterion
::
TimeCriterion
<
IN
>
timeCriterion
(
this
->
durations
[
i
]);
this
->
functions
[
i
](
this
->
algorithm
);
timeCriterion
.
init
();
this
->
algorithm
(
_in
,
timeCriterion
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment