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
1340937a
Commit
1340937a
authored
May 18, 2020
by
Alexis Lebis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new mutation
parent
adedcb1e
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
285 additions
and
43 deletions
+285
-43
course.cpp
src/model/course.cpp
+23
-2
course.h
src/model/course.h
+3
-0
mutation.h
src/model/ea/mutation.h
+259
-41
No files found.
src/model/course.cpp
View file @
1340937a
...
@@ -232,8 +232,8 @@ bool Course::_duplicataProtection(std::vector<std::pair<Competency,double>> *tea
...
@@ -232,8 +232,8 @@ bool Course::_duplicataProtection(std::vector<std::pair<Competency,double>> *tea
bool
Course
::
_lazyEquality
(
const
Course
&
c
)
const
bool
Course
::
_lazyEquality
(
const
Course
&
c
)
const
{
{
return
(
this
->
_id
==
c
.
id
()
&&
return
(
(
this
->
_id
==
c
.
id
()
||
this
->
_name
.
compare
(
c
.
name
())
==
0
&&
this
->
_name
.
compare
(
c
.
name
())
==
0
)
&&
this
->
_ects
==
c
.
ects
()
this
->
_ects
==
c
.
ects
()
);
);
}
}
...
@@ -298,4 +298,25 @@ int Course::assignID4TMP()
...
@@ -298,4 +298,25 @@ int Course::assignID4TMP()
}
}
return
++
COURSE_TMP_COUNTER
;
return
++
COURSE_TMP_COUNTER
;
}
}
/** It produces a new vector, which is another view of courses in param, sorted by TF
* Duplicates the behaviour of CSDVP::_makeCoursesSortedByTF() except that it applies to any vector of courses
* size of timeFrames must be equal to the maximal TF value in courses.timeFrames !
*/
std
::
vector
<
std
::
vector
<
Course
>>
Course
::
organiseByTF
(
std
::
vector
<
Course
>
courses
,
std
::
vector
<
int
>
timeFrames
)
{
std
::
vector
<
std
::
vector
<
Course
>>
coursesByTF
(
timeFrames
.
size
());
int
tmpIdx
;
for
(
int
i
=
0
;
i
<
courses
.
size
();
i
++
)
{
for
(
int
j
=
0
;
j
<
courses
.
at
(
i
).
timeFrame
().
size
();
j
++
)
{
tmpIdx
=
courses
.
at
(
i
).
timeFrame
().
at
(
j
)
-
timeFrames
.
at
(
0
);
coursesByTF
.
at
(
tmpIdx
).
push_back
(
courses
.
at
(
i
));
}
}
return
coursesByTF
;
}
// === END STATIC
// === END STATIC
\ No newline at end of file
src/model/course.h
View file @
1340937a
...
@@ -67,6 +67,8 @@ class Course
...
@@ -67,6 +67,8 @@ class Course
static
Course
build
(
int
ects
=
0
,
std
::
string
name
=
""
);
static
Course
build
(
int
ects
=
0
,
std
::
string
name
=
""
);
static
Course
buildTMP
(
int
ects
=
0
,
std
::
string
name
=
""
);
static
Course
buildTMP
(
int
ects
=
0
,
std
::
string
name
=
""
);
static
std
::
vector
<
std
::
vector
<
Course
>>
organiseByTF
(
std
::
vector
<
Course
>
courses
,
std
::
vector
<
int
>
timeFrames
);
/// Default constructor. Use Course::build instead !
/// Default constructor. Use Course::build instead !
Course
()
=
default
;
Course
()
=
default
;
...
@@ -75,6 +77,7 @@ class Course
...
@@ -75,6 +77,7 @@ class Course
const
std
::
string
name
()
const
{
return
this
->
_name
;};
const
std
::
string
name
()
const
{
return
this
->
_name
;};
const
int
ects
()
const
{
return
this
->
_ects
;}
const
int
ects
()
const
{
return
this
->
_ects
;}
const
std
::
vector
<
Competency
>
prerequisites
()
const
{
return
this
->
_prerequisites
;}
const
std
::
vector
<
Competency
>
prerequisites
()
const
{
return
this
->
_prerequisites
;}
std
::
vector
<
Competency
>&
unlocked_prerequisites
()
{
return
this
->
_prerequisites
;}
const
std
::
vector
<
int
>
timeFrame
()
const
{
return
this
->
_temporalAvailability
;}
const
std
::
vector
<
int
>
timeFrame
()
const
{
return
this
->
_temporalAvailability
;}
const
std
::
vector
<
std
::
pair
<
Competency
,
double
>>
teachedCompetenciesWeighted
()
const
{
return
this
->
_weightedTeached
;}
const
std
::
vector
<
std
::
pair
<
Competency
,
double
>>
teachedCompetenciesWeighted
()
const
{
return
this
->
_weightedTeached
;}
...
...
src/model/ea/mutation.h
View file @
1340937a
This diff is collapsed.
Click to expand it.
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