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
0027fd76
Commit
0027fd76
authored
Apr 29, 2020
by
Alexis Lebis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Magnitude defined + qucik test
parent
ffbd04bb
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
108 additions
and
7 deletions
+108
-7
main.cpp
application/main.cpp
+6
-0
competency.h
src/model/competency.h
+2
-1
course.h
src/model/course.h
+1
-1
magnitudeException.h
src/model/exception/magnitudeException.h
+29
-0
magnitude.cpp
src/model/magnitude.cpp
+58
-0
magnitude.h
src/model/magnitude.h
+9
-2
profession.h
src/model/profession.h
+1
-1
mapi.h
src/model/scale/mapi.h
+1
-1
scale.h
src/model/scale/scale.h
+1
-1
No files found.
application/main.cpp
View file @
0027fd76
...
...
@@ -5,8 +5,14 @@
#include <queenCrossover.h>
#include <queenEval.h>
#include <model/magnitude.h>
int
main
(
int
argc
,
char
*
argv
[]){
Magnitude
*
m
=
Magnitude
::
build
(
-
10.0
);
std
::
cout
<<
"Magnitude"
<<
m
->
value
()
<<
std
::
endl
;
//Define a QUEEN -> 1 line
QUEEN
s1
;
...
...
src/model/competency.h
View file @
0027fd76
...
...
@@ -2,7 +2,8 @@
#define SRC_COMPETENCY_H_
#include <string>
#include <magnitude.h>
#include "magnitude.h"
/**
* Represents the notion of a competency (a.k.a. "non operationalisable" skill).
...
...
src/model/course.h
View file @
0027fd76
...
...
@@ -3,7 +3,7 @@
#include <vector>
#include
<competency.h>
#include
"competency.h"
/**
* Represents a course in an academic structure.
...
...
src/model/exception/magnitudeException.h
0 → 100644
View file @
0027fd76
#ifndef SRC_EXCEPTION_MAGNITUDE_EXCEPTION_H_
#define SRC_EXCEPTION_MAGNITUDE_EXCEPTION_H_
#include <exception>
#include <string>
class
MagnitudeException
:
public
std
::
exception
{
private
:
double
_triedValue
;
std
::
string
_phrase
;
public
:
MagnitudeException
(
double
v
)
throw
()
:
_triedValue
(
v
)
{
this
->
_phrase
=
"Magnitude Exception: value ("
+
std
::
to_string
(
v
)
+
") is out of bound [0;1]."
;
}
virtual
const
char
*
what
()
const
throw
()
{
return
_phrase
.
c_str
();
}
virtual
~
MagnitudeException
()
throw
()
{}
};
#endif // SRC_EXCEPTION_MAGNITUDE_EXCEPTION_H_
\ No newline at end of file
src/model/magnitude.cpp
0 → 100644
View file @
0027fd76
#include "magnitude.h"
#include "exception/magnitudeException.h"
// === FACTORY
Magnitude
*
Magnitude
::
build
(
double
value
=
0
)
{
bool
isInRange
=
!
(
_inRange
(
value
));
if
(
!
isInRange
)
throw
MagnitudeException
(
value
);
else
return
new
Magnitude
(
value
);
}
// === CONSTRUCTOR
Magnitude
::
Magnitude
()
{
}
Magnitude
::
Magnitude
(
double
d
)
{
this
->
_value
=
d
;
}
// === FUNCTION
/** Checks if the value v is in [0;1]. If yes, return 0. Else, if v < 0 return -1, 1 otherwise
*/
const
int
Magnitude
::
_inRange
(
double
v
)
{
return
v
<
0
?
-
1
:
v
>
1
?
1
:
0
;
}
const
double
Magnitude
::
value
(){
return
this
->
_value
;}
/** Set the magnitude value of a competency. Indicates whether or not there is an overflow in
* the given v value (and that it has been automatically corrected)
*/
bool
Magnitude
::
set
(
double
v
)
{
int
isInRange
=
_inRange
(
v
);
switch
(
isInRange
)
{
case
-
1
:
this
->
_value
=
0
;
break
;
case
1
:
this
->
_value
=
1
;
break
;
default
:
this
->
_value
=
v
;
break
;
}
return
!
isInRange
;
}
\ No newline at end of file
src/model/magnitude.h
View file @
0027fd76
...
...
@@ -8,10 +8,17 @@
class
Magnitude
{
private
:
double
value
=
0
;
double
_value
=
0
;
//Constructor
Magnitude
();
Magnitude
(
double
);
// function
static
const
int
_inRange
(
double
);
public
:
Magnitude
();
static
Magnitude
*
build
(
double
);
//factory
//GETTER
const
double
value
();
...
...
src/model/profession.h
View file @
0027fd76
...
...
@@ -3,7 +3,7 @@
#include <vector>
#include
<competency.h>
#include
"competency.h"
/**
* A profession is a job sought by a student.
...
...
src/model/scale/mapi.h
View file @
0027fd76
#ifndef SRC_SCALE_MAPI_H_
#define SRC_SCALE_MAPI_H_
#include
<scale.h>
#include
"scale.h"
class
MAPIScale
:
public
Scale
{
...
...
src/model/scale/scale.h
View file @
0027fd76
#ifndef SRC_SCALE_SCALE_H_
#define SRC_SCALE_SCALE_H_
#include
<scaleValue.h>
#include
"scaleValue.h"
/** Represent a competency scale used by academic to assert competency level of a student.
*
...
...
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