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
88146714
Commit
88146714
authored
May 12, 2020
by
Alexis Lebis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add _course sorted by TF in CSDVP
parent
200848c8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
ceao_csdvp.cpp
application/ceao_csdvp.cpp
+9
-0
problem.cpp
src/model/problem.cpp
+18
-0
problem.h
src/model/problem.h
+5
-1
No files found.
application/ceao_csdvp.cpp
View file @
88146714
...
...
@@ -211,5 +211,14 @@ int main(int argc, char* argv[])
std
::
cout
<<
"CSDVP HAS BEEN CORRECTLY GENERATED!"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
pb
.
coursesSortedByTF
().
size
();
i
++
)
{
std
::
cout
<<
"TF#"
<<
std
::
to_string
(
i
)
<<
std
::
endl
;
for
(
int
j
=
0
;
j
<
pb
.
coursesSortedByTF
().
at
(
i
).
size
();
j
++
)
{
std
::
cout
<<
pb
.
coursesSortedByTF
().
at
(
i
).
at
(
j
)
<<
std
::
endl
;
}
}
return
EXIT_SUCCESS
;
}
\ No newline at end of file
src/model/problem.cpp
View file @
88146714
...
...
@@ -162,6 +162,23 @@ int CSDVP::CSDVP_COUNTER = 0;
this
->
_isConfig
=
true
;
return
this
->
_isConfig
;
}
void
CSDVP
::
_makeCoursesSortedByTF
()
{
//Init the vector of the size of the time frames
for
(
int
i
=
0
;
i
<
this
->
_timeFrames
.
size
();
i
++
)
this
->
_coursesSortedByTF
.
push_back
(
std
::
vector
<
Course
>
());
int
tmpIdx
;
for
(
int
i
=
0
;
i
<
this
->
_availableCourses
.
size
();
i
++
)
{
for
(
int
j
=
0
;
j
<
this
->
_availableCourses
.
at
(
i
).
timeFrame
().
size
();
j
++
)
{
tmpIdx
=
this
->
_availableCourses
.
at
(
i
).
timeFrame
().
at
(
j
)
-
this
->
_minimalTimeFrame
;
this
->
_coursesSortedByTF
.
at
(
tmpIdx
).
push_back
(
this
->
_availableCourses
.
at
(
i
));
}
}
}
// === END FUNC
// === STATIC
...
...
@@ -299,6 +316,7 @@ int CSDVP::CSDVP_COUNTER = 0;
pb
.
addCourseToCatalogue
(
tmpCourses
.
at
(
i
));
//From here, coursesCatalogue can still be < to minCourseTF * nbTF (due to the fact that a same course can belongs to )
pb
.
_makeCoursesSortedByTF
();
/* COMPETENCY CREATION
* We create _quantityAvailableCompetency competencies. For each comp, we randomly define it's magnitude.
...
...
src/model/problem.h
View file @
88146714
...
...
@@ -52,8 +52,9 @@ class CSDVP
// ---------- PROBLEM SPECIFIC ATTRIBUTES ----------
// Theses attributes represent the CSDVP
std
::
vector
<
int
>
_timeFrames
;
std
::
vector
<
int
>
_timeFrames
;
// Time frames stocks the VALUE, not the index
std
::
vector
<
Course
>
_availableCourses
;
std
::
vector
<
std
::
vector
<
Course
>>
_coursesSortedByTF
;
//sorted by standard index. e.g. TF[4;6] -> [0]=4; [1]=5 ; [2] = 6
std
::
vector
<
Competency
>
_availableCompentecies
;
///@todo implements a decay politics
...
...
@@ -77,6 +78,8 @@ class CSDVP
static
double
_randomizeIn
(
const
double
min
,
const
double
max
);
// --------- END GENERATION RELATED FUNCTION ---------
void
_makeCoursesSortedByTF
();
public
:
// --------- GENERATION RELATED FUNCTION ---------
/// allows a random attribution of pb's attributes
...
...
@@ -117,6 +120,7 @@ class CSDVP
const
std
::
vector
<
int
>
&
timeFrames
()
const
{
return
this
->
_timeFrames
;}
const
std
::
vector
<
Course
>
&
coursesCatalogue
()
const
{
return
this
->
_availableCourses
;}
const
std
::
vector
<
Competency
>
&
competencyCatalogue
()
const
{
return
this
->
_availableCompentecies
;}
const
std
::
vector
<
std
::
vector
<
Course
>>
&
coursesSortedByTF
()
const
{
return
this
->
_coursesSortedByTF
;}
std
::
vector
<
int
>
&
unlocked_timeFrames
(){
return
this
->
_timeFrames
;}
std
::
vector
<
Course
>
&
unlocked_coursesCatalogue
(){
return
this
->
_availableCourses
;}
std
::
vector
<
Competency
>
&
unlocked_competenciesCatalogue
(){
return
this
->
_availableCompentecies
;}
...
...
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