Actual phaser game object.
Holds the best distance to the goal in the human mode.
Holds the number of tries/iterations performed.
If the human mode is enabled, the number corresponds to the tries made by the human player, if the human mode is disabled, the number corresponds to the population-iteration of the genetic algorithm.
List containing the individuals of the current iteration.
The scenes to which the utils belongs.
Appends the given text in a new line to the verbose console.
Text which should be appended to the console.
Appends the given text to the verbose console.
Text which should be appended to the console.
Converts a given value in the range from 0 to 100 to a percentage value used in the configuration (range 0 to 1) with a given precision.
The value which should be converted to a percentage value. Must be between 0 and 100.
The precision of the percentage (i.e. how many places after the decimal point).
Fills the HTML-elements with the configuration values.
Performs any work needed for initializing the ConfigurationHandler.
The content of the configuration.
Initializes all event listeners.
Performs any actions needed to restart a new game (i.e. resets all variables).
Sets the scenes.
The new scenes.
Updates the necessary HTMLElements with the new distance. Note: Must only be called once the current iteration has come to a complete stop.
Number holding the average distance to the goal of the population of the last iteration.
Number holding the best distance to the goal of the population of the last iteration.
Updates the configuration handler with the new values from the HTML input elements.
Updates the necessary HTMLElements with the new distance.
New distance in pixels.
If true
the humanBestDistance will also be updated, if necessary, else not.
Should only be true
if the marble has stopped.
Updates the iterationCounter and all relevant HTMLElements to the updated iteration count.
The delta by which the iteration count should increase/decrease.
Sets up a vector pointing from a given start point to the current pointer position (mostly the mouse).
The pointer which is currently active.
Start point of the vector.
Returns the created vector.
Writes the given text to the verbose console.
Text which should be written to the console.
Checks whether all individuals are stopped or not.
Returns true
if all individuals have stopped, else false
.
Computes the average distance to the goal of the current population.
Returns the average distance to the goal.
Fetches the best (i.e. lowest) distance to the goal of the current population.
Returns the best (i.e. lowest) to the goal.
Initializes the algorithm.
The initial population.
Performs action needed to conclude an iteration.
Calls the fitness function for each individual and generates based on the fitness values a new generation.
Kills the entire population and removes it from the scene.
Use with care.
Performs the random select of an individual for the reproduction.
The random select uses the fitness function of each individual to select among the population one of the fittest individuals.
The individual gets chosen according to the Fitness proportionate selection also known as roulette wheel selection algorithm (See the Wikipedia article for further details).
That means, that the individual with the highest fitness has the highest probability that it will be chosen. Nevertheless, also a 'non-fit-individual' has a, of course small, chance that it will be selected for reproduction.
List containing the fitness values of all individuals of the population. The first value of the fitness list is the fitness value of the first individual in the population, the second from the second and so forth.
The individual which is chosen for reproduction.
Starts a new iteration.
Stops the current iteration and creates a new population.
Configuration for the gaaaaame.
Generated using TypeDoc
Holds the best distance to the goal in the ai mode. (i.e. not in human mode - performed by the genetic algorithm).
The lower the distance is, the better.