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
80f463e7
Commit
80f463e7
authored
4 years ago
by
jerem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"debug de la function template"
parent
dca2c2f1
test
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
24 deletions
+36
-24
ceao_competency.cpp
application/ceao_competency.cpp
+9
-1
FindParadiseo.cmake
cmake/module/FindParadiseo.cmake
+2
-0
course.cpp
src/model/course.cpp
+1
-22
course.h
src/model/course.h
+24
-1
No files found.
application/ceao_competency.cpp
View file @
80f463e7
...
...
@@ -6,6 +6,7 @@
#include "model/magnitude.h"
#include "model/competency.h"
#include "model/course.h"
#include "model/exception/magnitudeException.h"
#include "model/exception/competencyEvolvingException.h"
...
...
@@ -17,6 +18,13 @@ int main(int argc, char* argv[])
Competency
c2
=
Competency
::
build
(
m
,
""
);
Competency
c3
=
Competency
::
build
(
0.5
);
std
::
vector
<
Competency
>
vec
;
vec
.
push_back
(
c
);
vec
.
push_back
(
c2
);
vec
.
push_back
(
c3
);
Course
cour
=
Course
::
build
();
cour
.
findInVector
(
vec
,
c
);
assert
(
c3
.
name
().
compare
(
"Competency#"
+
std
::
to_string
(
c3
.
id
()))
==
0
);
std
::
cout
<<
"Default naming ok"
<<
std
::
endl
;
...
...
@@ -58,4 +66,4 @@ int main(int argc, char* argv[])
std
::
cout
<<
"c != c3 OK"
<<
std
::
endl
;
return
EXIT_SUCCESS
;
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
cmake/module/FindParadiseo.cmake
View file @
80f463e7
...
...
@@ -48,6 +48,7 @@ set(BUILD_DIR build)
# Path
set
(
PARADISEO_SRC_PATHS
/home/jerem/Softs/ParadisEO-2.0/
${
PARADISEO_ROOT
}
$ENV{PARADISEO_ROOT}
/usr/local/
...
...
@@ -101,6 +102,7 @@ endif()
set
(
PARADISEO_FOUND true
)
# will be set to false if one of the required modules is not found
set
(
FIND_PARADISEO_LIB_PATHS
/home/jerem/Softs/ParadisEO-2.0/build/
${
PARADISEO_ROOT
}
/
${
BUILD_DIR
}
$ENV{PARADISEO_ROOT}
/usr/local/
...
...
This diff is collapsed.
Click to expand it.
src/model/course.cpp
View file @
80f463e7
...
...
@@ -187,27 +187,6 @@ bool Course::_duplicataProtection(std::vector<std::pair<Competency,double>> *tea
return
(
it
!=
teached
->
end
()
&&
!
(
teached
->
at
(
index
).
first
==
c
)
);
}
// template<typename T>
// std::pair<int, T> Course::findInVector(const std::vector<T> & vec, const T & findMe)
// {
// std::pair<int, T> res;
// typename std::vector<T>::iterator it = std::find( vec.begin(), vec.end(), findMe);
// if(it == vec.end())
// {
// res.first = -1;
// res.second; //NTD, -1 SHOULD BE USED TO DETECT THAT NOTHING HAS BEEN FOUND
// }
// else
// {
// res.first = std::distance(vec.begin(), it);
// res.second = vec.at(res.first);
// }
// return res;
// }
// === OPERATOR
std
::
ostream
&
operator
<<
(
std
::
ostream
&
Stream
,
const
Course
&
c
)
{
...
...
@@ -224,4 +203,4 @@ int Course::assignID()
{
return
++
Course
::
COURSE_COUNTER
;
}
// === END STATIC
\ No newline at end of file
// === END STATIC
This diff is collapsed.
Click to expand it.
src/model/course.h
View file @
80f463e7
...
...
@@ -55,6 +55,29 @@ class Course
public
:
static
Course
build
(
int
ects
=
0
,
std
::
string
name
=
""
);
template
<
typename
T
>
std
::
pair
<
int
,
T
>
findInVector
(
std
::
vector
<
T
>
&
vec
,
const
T
&
findMe
)
{
std
::
pair
<
int
,
T
>
res
;
typename
std
::
vector
<
T
>::
iterator
it
=
std
::
find
(
vec
.
begin
(),
vec
.
end
(),
findMe
);
if
(
it
==
vec
.
end
())
{
res
.
first
=
-
1
;
res
.
second
;
//NTD, -1 SHOULD BE USED TO DETECT THAT NOTHING HAS BEEN FOUND
}
else
{
res
.
first
=
std
::
distance
(
vec
.
begin
(),
it
);
res
.
second
=
vec
.
at
(
res
.
first
);
}
return
res
;
}
// === GETTER
const
int
id
()
const
{
return
this
->
_id
;};
const
std
::
string
name
()
const
{
return
this
->
_name
;};
...
...
@@ -99,4 +122,4 @@ std::ostream & operator<<(std::ostream& Stream, const Course & c);
#endif // SRC_COURSE_H_
\ No newline at end of file
#endif // SRC_COURSE_H_
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