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
c8de579d
Commit
c8de579d
authored
1 year ago
by
Caron Olivier
Browse files
Options
Downloads
Patches
Plain Diff
remove temporary executable file
parent
6f9c5ca0
No related branches found
No related tags found
No related merge requests found
Pipeline
#4511
failed
1 year ago
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CMakeLists.txt
+0
-3
0 additions, 3 deletions
src/CMakeLists.txt
src/representation/permutation/problems/fsp/NoWaitFSP.h
+1
-1
1 addition, 1 deletion
src/representation/permutation/problems/fsp/NoWaitFSP.h
src/testA.cpp
+0
-105
0 additions, 105 deletions
src/testA.cpp
with
1 addition
and
109 deletions
src/CMakeLists.txt
+
0
−
3
View file @
c8de579d
...
...
@@ -6,6 +6,3 @@
# To create bundles of sources:
# set(<NAME> source1 [source2 ...])
# Then use ${NAME}
add_executable
(
testA testA.cpp
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/representation/permutation/problems/fsp/NoWaitFSP.h
+
1
−
1
View file @
c8de579d
...
...
@@ -31,7 +31,7 @@ namespace representation::permutation::problems::fsp {
/**
* Class representing a No-Wait FlowShop Problem) instance
*/
class
NoWaitFSP
:
public
FSP
{
class
NoWaitFSP
:
public
representation
::
permutation
::
problems
::
fsp
::
FSP
{
public:
explicit
NoWaitFSP
(
const
std
::
string
&
instanceFile
)
:
FSP
(
instanceFile
)
{
this
->
initDelay
();
...
...
This diff is collapsed.
Click to expand it.
src/testA.cpp
deleted
100644 → 0
+
0
−
105
View file @
6f9c5ca0
//
// Created by carono on 03/06/24.
//
#include
"util/RNGHelper.h"
#include
"opt/criterion/TimeCriterion.h"
#include
"opt/checkpoint/ArchiveCheckpoint.h"
#include
"core/Archive.h"
#include
"core/fitness/FitnessMin.h"
#include
"representation/permutation/problems/tsp/TSP.h"
#include
"representation/permutation/problems/tsp/TSPEval.h"
#include
"representation/permutation/problems/tsp/TSPEvalBiObjective.h"
#include
"opt/factory/singleSolution/NeighborFactory.h"
#include
"opt/singleSolution/neighborhood/neighbor/IndexNeighbor.h"
#include
"opt/manySolutions/geneticAlgorithm/crossover/OXCrossover.h"
#include
"opt/manySolutions/geneticAlgorithm/mutation/Mutation.h"
#include
"opt/manySolutions/geneticAlgorithm/NSGA2_Solution.h"
#include
"opt/manySolutions/geneticAlgorithm/NSGA2_Algorithm.h"
#include
"opt/manySolutions/geneticAlgorithm/NSGA2_Eval.h"
#include
"core/archive/AllAcceptedArchive.h"
using
namespace
representation
::
permutation
::
problems
::
tsp
;
typedef
core
::
fitness
::
FitnessMin
<
double
>
FIT
;
typedef
TSPSol
<
FIT
>
SOL
;
typedef
TSPEvalBiObjective
<
SOL
>
EVAL
;
typedef
opt
::
manySolutions
::
geneticAlgorithm
::
NSGA2_Solution
<
SOL
>
NSGA2_SOL
;
typedef
core
::
archive
::
AllAcceptedArchive
<
NSGA2_SOL
>
POP
;
typedef
opt
::
manySolutions
::
geneticAlgorithm
::
crossover
::
OXCrossover
<
POP
>
CROSSOVER
;
typedef
opt
::
manySolutions
::
geneticAlgorithm
::
mutation
::
Mutation
<
POP
>
MUTATION
;
typedef
opt
::
criterion
::
TimeCriterion
<
POP
>
STOP
;
typedef
opt
::
manySolutions
::
geneticAlgorithm
::
NSGA2_Algorithm
<
POP
>
GA
;
int
main
()
{
util
::
RNGHelper
::
get
()
->
reseed
(
120
);
std
::
vector
<
std
::
vector
<
double
>>
distanceMatrix
=
{
{
0
,
10
,
15
,
20
},
{
10
,
0
,
35
,
25
},
{
15
,
35
,
0
,
30
},
{
20
,
25
,
30
,
0
}
};
std
::
vector
<
std
::
vector
<
double
>>
timeMatrix
=
{{
{
0
,
1
,
3
,
4
},
{
1
,
0
,
5
,
2
},
{
3
,
5
,
0
,
6
},
{
4
,
2
,
6
,
0
}
}};
TSP
tsp1
(
distanceMatrix
);
TSP
tsp2
(
timeMatrix
);
TSPEval
<
SOL
>
tsp1eval
(
tsp1
);
TSPEval
<
SOL
>
tsp2eval
(
tsp2
);
EVAL
eval
(
tsp1eval
,
tsp2eval
);
NSGA2_Eval
<
SOL
>
nsga2_eval
(
eval
)
;
POP
population
;
population
.
clear
();
unsigned
long
long
int
values
[
4
][
4
]
=
{
{
0
,
1
,
2
,
3
},
{
0
,
2
,
1
,
3
},
{
0
,
3
,
1
,
2
},
{
0
,
2
,
3
,
1
}
};
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
SOL
sol
;
for
(
int
j
=
0
;
j
<
4
;
j
++
)
{
sol
.
push_back
(
values
[
i
][
j
]);
}
NSGA2_SOL
decorator
(
sol
)
;
population
(
decorator
);
}
for
(
auto
&
s
:
population
)
{
nsga2_eval
(
s
);
s
.
fitness
().
validate
();
}
// components for NSGA2 algorithm
STOP
stopGen
(
1000
)
;
// using TimeCriterion with 1 seconds
CROSSOVER
crossover
(
0.8
,
nsga2_eval
)
;
// neighbor operator for mutation step
opt
::
factory
::
singleSolution
::
NeighborFactory
<
NSGA2_SOL
,
opt
::
singleSolution
::
neighborhood
::
neighbor
::
IndexNeighbor
<
NSGA2_SOL
>>
neighborFactory
;
opt
::
singleSolution
::
neighborhood
::
neighbor
::
IndexNeighbor
<
NSGA2_SOL
>
*
neighbor
=
neighborFactory
.
create
(
"2opt"
);
MUTATION
mutation
(
0.15
,
nsga2_eval
,
*
neighbor
);
opt
::
checkpoint
::
ArchiveCheckpoint
<
POP
>
archiveCheckpoint
;
GA
ga
(
&
crossover
,
&
mutation
,
nsga2_eval
,
&
stopGen
)
;
ga
.
setCheckpoint
(
archiveCheckpoint
);
ga
(
population
)
;
// run the genetic algorithm
std
::
cout
<<
"final population :"
<<
std
::
endl
<<
population
<<
std
::
endl
;
}
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
register
or
sign in
to comment