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
8c445303
Commit
8c445303
authored
May 11, 2020
by
Alexis Lebis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new pickedCourse attr for csdvp
parent
55df3941
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
2 deletions
+27
-2
ceao_csdvp.cpp
application/ceao_csdvp.cpp
+6
-0
main.cpp
application/main.cpp
+5
-1
problem.cpp
src/model/problem.cpp
+6
-1
problem.h
src/model/problem.h
+10
-0
No files found.
application/ceao_csdvp.cpp
View file @
8c445303
...
...
@@ -84,6 +84,10 @@ int main(int argc, char* argv[])
}
pb
.
set_cfg_courseByTFMin
(
4
);
assert
(
pb
.
getQuantityCoursesToPick
()
==
-
1
);
//'cauz pb is not yet fully config
pb
.
set_cfg_pickedCoursesByTimeFrame
(
3
);
pb
.
set_cfg_ectsMax
(
2
);
try
...
...
@@ -142,6 +146,8 @@ int main(int argc, char* argv[])
assert
(
pb
.
checkConfig
());
std
::
cout
<<
"CSDVP has been correctly configurated"
<<
std
::
endl
;
assert
(
pb
.
getQuantityCoursesToPick
()
==
3
*
6
);
//course to pick * number of timeframe max - min +1
assert
(
pb
.
timeFrames
().
at
(
0
)
==
pb
.
cfg_minimalTimeFrame
());
assert
(
pb
.
timeFrames
().
at
(
1
)
==
pb
.
cfg_minimalTimeFrame
()
+
1
);
assert
(
pb
.
timeFrames
().
at
(
pb
.
timeFrames
().
size
()
-
1
)
==
pb
.
cfg_maximalTimeFrame
());
...
...
application/main.cpp
View file @
8c445303
...
...
@@ -20,6 +20,7 @@
int
main
(
int
argc
,
char
*
argv
[]){
// ================================ TEST ZONE ===========================================
std
::
cout
<<
"MAGNITUDE TEST ZONE"
<<
std
::
endl
;
Magnitude
m
=
Magnitude
::
build
(
0.5
);
Magnitude
n
=
Magnitude
::
build
(
0.3
);
Magnitude
o
=
Magnitude
::
build
(
0.2
);
...
...
@@ -51,12 +52,15 @@ int main(int argc, char* argv[]){
}
std
::
cout
<<
"Inspect m value:"
<<
m
.
value
()
<<
std
::
endl
;
std
::
cout
<<
"END MAGNITUDE TEST
\n\n\n
"
<<
std
::
endl
;
// ================================= END TEST ZONE =====================================
// ================================= CEAO ZONE ===================================
//CSDVP pb;
Cursus
c1
;
CursusInit
init
(
8
,
1
);
CursusInit
init
(
8
,
1
);
//init(pb.getQuantityCoursesToPick(),1);
CursusEval
eval
;
CursusMutation
mut
;
CursusCrossover
xOver
;
...
...
src/model/problem.cpp
View file @
8c445303
...
...
@@ -66,6 +66,8 @@ int CSDVP::CSDVP_COUNTER = 0;
{
this
->
_minimalPrerequisiteByCourse
=
nb
;}
void
CSDVP
::
set_cfg_maximalPrerequisiteByCourse
(
int
nb
)
{
this
->
_maximalPrerequisiteByCourse
=
nb
;}
void
CSDVP
::
set_cfg_pickedCoursesByTimeFrame
(
int
nb
)
{
this
->
_pickedCoursesByTimeFrame
=
nb
;}
void
CSDVP
::
set_cfg_minimalMagnitude
(
double
m
)
{
this
->
_minimalMagnitude
=
Magnitude
::
build
(
m
);
...
...
@@ -128,7 +130,8 @@ int CSDVP::CSDVP_COUNTER = 0;
this
->
_maximalCompetencyByCourse
<
0
||
this
->
_minimalCompetencyByCourse
<
0
||
this
->
_minimalPrerequisiteByCourse
<
0
||
this
->
_maximalPrerequisiteByCourse
<
0
)
this
->
_maximalPrerequisiteByCourse
<
0
||
this
->
_pickedCoursesByTimeFrame
<
1
)
{
this
->
_isConfig
=
false
;
return
this
->
_isConfig
;
...
...
@@ -153,6 +156,8 @@ int CSDVP::CSDVP_COUNTER = 0;
throw
CSDVPBadlyConfiguratedException
(
"this->_minimalCompetencyByCourse >= this->_quantityAvailableCompetencies"
);
if
(
this
->
_quantityAvailableCompetencies
<
this
->
_maximalCompetencyByCourse
)
throw
CSDVPBadlyConfiguratedException
(
"this->_quantityAvailableCompetencies < this->_maximalCompetencyByCourse"
);
if
(
this
->
_pickedCoursesByTimeFrame
>
this
->
_minimalCoursesByTimeFrame
)
throw
CSDVPBadlyConfiguratedException
(
"this->_pickedCoursesByTimeFrame > this->_minimalCoursesByTimeFrame"
);
this
->
_isConfig
=
true
;
return
this
->
_isConfig
;
...
...
src/model/problem.h
View file @
8c445303
...
...
@@ -44,6 +44,8 @@ class CSDVP
int
_minimalPrerequisiteByCourse
;
int
_maximalPrerequisiteByCourse
;
int
_pickedCoursesByTimeFrame
;
Magnitude
_minimalMagnitude
;
Magnitude
_maximalMagnitude
;
// ---------- END CONFIGURATION ATTRIBUTES ----------
...
...
@@ -108,6 +110,7 @@ class CSDVP
const
int
cfg_competencyByCourseMax
()
const
{
return
this
->
_maximalCompetencyByCourse
;}
const
int
cfg_prerequisiteByCourseMin
()
const
{
return
this
->
_minimalPrerequisiteByCourse
;}
const
int
cfg_prerequisiteByCourseMax
()
const
{
return
this
->
_maximalPrerequisiteByCourse
;}
const
int
cfg_pickedCoursesByTimeFrame
()
const
{
return
this
->
_pickedCoursesByTimeFrame
;}
const
Magnitude
&
cfg_magnitudeMin
()
const
{
return
this
->
_minimalMagnitude
;}
const
Magnitude
&
cfg_magnitudeMax
()
const
{
return
this
->
_maximalMagnitude
;}
...
...
@@ -117,6 +120,12 @@ class CSDVP
std
::
vector
<
int
>
&
unlocked_timeFrames
(){
return
this
->
_timeFrames
;}
std
::
vector
<
Course
>
&
unlocked_coursesCatalogue
(){
return
this
->
_availableCourses
;}
std
::
vector
<
Competency
>
&
unlocked_competenciesCatalogue
(){
return
this
->
_availableCompentecies
;}
const
int
getQuantityCoursesToPick
()
const
{
if
(
this
->
_isConfig
)
return
this
->
_timeFrames
.
size
()
*
this
->
_pickedCoursesByTimeFrame
;
return
-
1
;
//if not config
}
///@todo getDecayPolitic
// === MUTATOR
...
...
@@ -137,6 +146,7 @@ class CSDVP
void
set_cfg_maximalCompetencyByCourse
(
int
nb
);
void
set_cfg_minimalPrerequisiteByCourse
(
int
nb
);
void
set_cfg_maximalPrerequisiteByCourse
(
int
nb
);
void
set_cfg_pickedCoursesByTimeFrame
(
int
nb
);
void
setTimeFrames
(
std
::
vector
<
int
>
&
v
);
void
setCoursesCatalogue
(
std
::
vector
<
Course
>
&
);
...
...
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