Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–44 unchanged (44 lines)
45 * @throws OutOfRangeException if the elitism rate is outside the [0, 1] range
46 */
47 public ElitisticListPopulation(final List<Chromosome> chromosomes,
48 final int populationLimit,
49 final double elitismRate) {
50 super(chromosomes, populationLimit);
51 this.elitismRate = elitismRate;
52 }
53
54 /**
55 * Creates a new ListPopulation instance and initializes its inner
56 * chromosome list.
57 *
58 * @param populationLimit maximal size of the population
59 * @param elitismRate how many best chromosomes will be directly transferred to the
60 * next generation [in %]
61 * @throws OutOfRangeException if the elitism rate is outside the [0, 1] range
62 */
63 public ElitisticListPopulation(final int populationLimit, final double elitismRate) {
64 super(populationLimit);
65 this.elitismRate = elitismRate;
66 }
67
68 /**
69 * Start the population for the next generation. The <code>{@link #elitismRate}</code>
70 * percents of the best chromosomes are directly copied to the next generation.
71 *
…lines 72–113 unchanged (42 lines)

After

…lines 1–44 unchanged (44 lines)
45 * @throws OutOfRangeException if the elitism rate is outside the [0, 1] range
46 */
47 public ElitisticListPopulation(final List<Chromosome> chromosomes,
48 final int populationLimit,
49 final double elitismRate) {
50 super(chromosomes, populationLimit);
51 setElitismRate(elitismRate);
52 }
53
54 /**
55 * Creates a new ListPopulation instance and initializes its inner
56 * chromosome list.
57 *
58 * @param populationLimit maximal size of the population
59 * @param elitismRate how many best chromosomes will be directly transferred to the
60 * next generation [in %]
61 * @throws OutOfRangeException if the elitism rate is outside the [0, 1] range
62 */
63 public ElitisticListPopulation(final int populationLimit, final double elitismRate) {
64 super(populationLimit);
65 setElitismRate(elitismRate);
66 }
67
68 /**
69 * Start the population for the next generation. The <code>{@link #elitismRate}</code>
70 * percents of the best chromosomes are directly copied to the next generation.
71 *
…lines 72–113 unchanged (42 lines)

Before

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "genetics"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "exception"
. "."
identifier "OutOfRangeException"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "util"
. "."
identifier "FastMath"
; ";"
block_comment "/**\n * Population of chromosomes which uses elitism (certain"...
class_declaration
modifiers
public "public"
class "class"
identifier "ElitisticListPopulation"
superclass
extends "extends"
type_identifier "ListPopulation"
class_body
{ "{"
block_comment "/** percentage of chromosomes copied to the next generation "...
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "elitismRate"
= "="
decimal_floating_point_literal "0.9"
; ";"
block_comment "/**\n * Creates a new ElitisticListPopulation instance.\n "...
constructor_declaration
modifiers
public "public"
identifier "ElitisticListPopulation"
formal_parameters (+27 nodes collapsed)
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
identifier "chromosomes"
, ","
identifier "populationLimit"
) ")"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "elitismRate"
= "="
identifier "elitismRate"
; ";"
} "}"
block_comment "/**\n * Creates a new ListPopulation instance and initial"...
constructor_declaration
modifiers
public "public"
identifier "ElitisticListPopulation"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
integral_type
int "int"
identifier "populationLimit"
, ","
formal_parameter
modifiers
final "final"
floating_point_type
double "double"
identifier "elitismRate"
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
identifier "populationLimit"
) ")"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "elitismRate"
= "="
identifier "elitismRate"
; ";"
} "}"
block_comment "/**\n * Start the population for the next generation. The"...
method_declaration (+159 nodes collapsed)
block_comment "/**\n * Sets the elitism rate, i.e. how many best chromos"...
method_declaration (+63 nodes collapsed)
block_comment "/**\n * Access the elitism rate.\n * @return the eliti"...
method_declaration
modifiers
public "public"
floating_point_type
double "double"
identifier "getElitismRate"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "elitismRate"
; ";"
} "}"
} "}"

After

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "genetics"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "exception"
. "."
identifier "OutOfRangeException"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "util"
. "."
identifier "FastMath"
; ";"
block_comment "/**\n * Population of chromosomes which uses elitism (certain"...
class_declaration
modifiers
public "public"
class "class"
identifier "ElitisticListPopulation"
superclass
extends "extends"
type_identifier "ListPopulation"
class_body
{ "{"
block_comment "/** percentage of chromosomes copied to the next generation "...
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "elitismRate"
= "="
decimal_floating_point_literal "0.9"
; ";"
block_comment "/**\n * Creates a new ElitisticListPopulation instance.\n "...
constructor_declaration
modifiers
public "public"
identifier "ElitisticListPopulation"
formal_parameters (+27 nodes collapsed)
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
identifier "chromosomes"
, ","
identifier "populationLimit"
) ")"
; ";"
expression_statement
method_invocation
identifier "setElitismRate"
argument_list
( "("
identifier "elitismRate"
) ")"
; ";"
} "}"
block_comment "/**\n * Creates a new ListPopulation instance and initial"...
constructor_declaration
modifiers
public "public"
identifier "ElitisticListPopulation"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
integral_type
int "int"
identifier "populationLimit"
, ","
formal_parameter
modifiers
final "final"
floating_point_type
double "double"
identifier "elitismRate"
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
super "super"
argument_list
( "("
identifier "populationLimit"
) ")"
; ";"
expression_statement
method_invocation
identifier "setElitismRate"
argument_list
( "("
identifier "elitismRate"
) ")"
; ";"
} "}"
block_comment "/**\n * Start the population for the next generation. The"...
method_declaration (+159 nodes collapsed)
block_comment "/**\n * Sets the elitism rate, i.e. how many best chromos"...
method_declaration (+63 nodes collapsed)
block_comment "/**\n * Access the elitism rate.\n * @return the eliti"...
method_declaration
modifiers
public "public"
floating_point_type
double "double"
identifier "getElitismRate"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "elitismRate"
; ";"
} "}"
} "}"