Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
java-wowa-training
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
java-wowa-training
Commits
180aa3ec
Commit
180aa3ec
authored
6 years ago
by
a.croix
Browse files
Options
Downloads
Patches
Plain Diff
Structure improvements
parent
131b996d
No related branches found
No related tags found
No related merge requests found
Pipeline
#1030
failed
6 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/be/cylab/java/wowa/training/Trainer.java
+1
-1
1 addition, 1 deletion
src/main/java/be/cylab/java/wowa/training/Trainer.java
src/main/java/be/cylab/java/wowa/training/TrainerParameters.java
+11
-7
11 additions, 7 deletions
...n/java/be/cylab/java/wowa/training/TrainerParameters.java
with
12 additions
and
8 deletions
src/main/java/be/cylab/java/wowa/training/Trainer.java
+
1
−
1
View file @
180aa3ec
...
@@ -374,7 +374,7 @@ public class Trainer {
...
@@ -374,7 +374,7 @@ public class Trainer {
double
[]
expected
double
[]
expected
)
{
)
{
List
<
SolutionDistance
>
parents
=
this
.
selectParents
(
population
,
List
<
SolutionDistance
>
parents
=
this
.
selectParents
(
population
,
this
.
getParameters
().
getNumber
_of_p
arents
(),
this
.
getParameters
().
getNumber
OfP
arents
(),
this
.
getParameters
().
getSelectionMethod
());
this
.
getParameters
().
getSelectionMethod
());
List
<
SolutionDistance
>
new_generation
=
this
.
doReproduction
(
parents
);
List
<
SolutionDistance
>
new_generation
=
this
.
doReproduction
(
parents
);
List
<
SolutionDistance
>
mutated
=
List
<
SolutionDistance
>
mutated
=
...
...
This diff is collapsed.
Click to expand it.
src/main/java/be/cylab/java/wowa/training/TrainerParameters.java
+
11
−
7
View file @
180aa3ec
...
@@ -64,15 +64,18 @@ public class TrainerParameters {
...
@@ -64,15 +64,18 @@ public class TrainerParameters {
}
}
/**
public
int
getNumber_of_parents
()
{
* Getter for number of parents.
return
number_of_parents
;
* @return int
*/
final
int
getNumberOfParents
()
{
return
this
.
number_of_parents
;
}
}
/**
/**
* @return Logger
* @return Logger
*/
*/
final
protected
Logger
getLogger
()
{
final
Logger
getLogger
()
{
return
logger
;
return
logger
;
}
}
...
@@ -81,7 +84,7 @@ public class TrainerParameters {
...
@@ -81,7 +84,7 @@ public class TrainerParameters {
* Getter for population_size.
* Getter for population_size.
* @return int
* @return int
*/
*/
final
public
int
getPopulationSize
()
{
final
int
getPopulationSize
()
{
return
population_size
;
return
population_size
;
}
}
...
@@ -105,7 +108,8 @@ public class TrainerParameters {
...
@@ -105,7 +108,8 @@ public class TrainerParameters {
*/
*/
private
void
setCrossoverRate
(
final
int
crossover_rate
)
{
private
void
setCrossoverRate
(
final
int
crossover_rate
)
{
this
.
crossover_rate
=
crossover_rate
;
this
.
crossover_rate
=
crossover_rate
;
int
nbr_parents
=
Math
.
round
(
this
.
population_size
*
(
1
-
crossover_rate
/
100
));
int
nbr_parents
=
Math
.
round
(
this
.
population_size
*
(
1
-
crossover_rate
/
100
));
if
(
nbr_parents
%
2
==
1
)
{
if
(
nbr_parents
%
2
==
1
)
{
nbr_parents
++;
nbr_parents
++;
}
}
...
@@ -116,7 +120,7 @@ public class TrainerParameters {
...
@@ -116,7 +120,7 @@ public class TrainerParameters {
* Getter for mutation rate.
* Getter for mutation rate.
* @return int
* @return int
*/
*/
public
int
getMutationRate
()
{
final
int
getMutationRate
()
{
return
mutation_rate
;
return
mutation_rate
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment