jaga.control
Class Monica

java.lang.Object
  |
  +--jaga.control.Monica
All Implemented Interfaces:
islandev.EvolutionaryInteractiveTask, distrit.InteractiveTask, java.io.Serializable, distrit.Task

public class Monica
extends java.lang.Object
implements islandev.EvolutionaryInteractiveTask

The main evolutionary control module is in charge of:

  • Evolving generations.
  • Keeping track of evolution statistics, like fitness averages, best individuals, etc..
  • Implementing the distrit.InteractiveTask interface for this to be run on a distributed client like distrit.client.InteractiveTaskClient which connects to a server like MonicaServer. The get and set methods are designed to interface with the islandev.IslandsEvolutionServer of which MonicaServer is an implementation. But these methods can also be used just to get information about the progress of the current evolutionary run.
  • See Also:
    Serialized Form

    Fields inherited from interface islandev.EvolutionaryInteractiveTask
    REPORT_AVG_FITNESS, REPORT_AVG_MIGRATOR, REPORT_BEST_IND, REPORT_GENERATION, REPORT_POP_DUMP
     
    Constructor Summary
    Monica(InteractionModel im)
              Creates new Monica
    Monica(InteractionModel im, int popLogFreq)
              Creates new Monica
    Monica(InteractionModel im, int popLogFreq, int maxGenerations)
              Creates new Monica
     
    Method Summary
     java.lang.Object get(java.lang.Object params)
              Used to get output from the task Creates a report of what's going on inside.
     int[] getGenerations()
              Sending array itself by reference so could be destroyed.
     int[] getPopulationSizes()
              return Array of integers with the sizes of each population
     islandev.SnapshotPainter getSnapshotPainter()
               
     islandev.Individual getSolutionTemplate()
              return Object of type individual so that we should keep evolving if our current best is smaller than this one using their compareTo method.
     java.lang.String name()
               
     java.lang.Object run(java.lang.Object params)
              Runs whatever experiment on whatever deployment for whatever generations.
     void set(java.lang.Object paramsAndWhat)
              Used to send input to the task
     void setName(java.lang.String pName)
               
     java.lang.String toString()
               
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    Monica

    public Monica(InteractionModel im,
                  int popLogFreq,
                  int maxGenerations)
    Creates new Monica
    Parameters:
    popLogFreq - every how many generations to send the whole population over to the server to be logged.
    maxGenerations - after how many generations to stop evolving.

    Monica

    public Monica(InteractionModel im,
                  int popLogFreq)
    Creates new Monica
    Parameters:
    popLogFreq - every how many generations to send the whole population over to the server to be logged.

    Monica

    public Monica(InteractionModel im)
    Creates new Monica
    Method Detail

    get

    public java.lang.Object get(java.lang.Object params)
    Used to get output from the task Creates a report of what's going on inside.
    Specified by:
    get in interface distrit.InteractiveTask
    Parameters:
    params - is equal to "GUI" if gui is getting.
    Returns:
    a Vector whose elements are 0: Vector of best Genotypes.

    1: Vector of Integers of current generations.

    2: Vector of Doubles of average fitness.

    3: Vector of migrating individuals.

    4: String showing performance of best individual.

    5: [Optional] Vector with History of array of Populations.


    set

    public void set(java.lang.Object paramsAndWhat)
    Used to send input to the task
    Specified by:
    set in interface distrit.InteractiveTask
    Parameters:
    paramsAndWhat - here will be getting vector of incoming migrators to be added to each population

    run

    public java.lang.Object run(java.lang.Object params)
                         throws java.lang.InterruptedException
    Runs whatever experiment on whatever deployment for whatever generations.

    Note the Evolver must already have the first generation of individuals.

    Specified by:
    run in interface distrit.Task
    Parameters:
    params - Integer saying how many generations of evolutions to run for
    Returns:
    Vector of best genotypes of each population

    toString

    public java.lang.String toString()
    Overrides:
    toString in class java.lang.Object

    name

    public java.lang.String name()

    setName

    public void setName(java.lang.String pName)

    getPopulationSizes

    public int[] getPopulationSizes()
    Description copied from interface: islandev.EvolutionaryInteractiveTask
    return Array of integers with the sizes of each population
    Specified by:
    getPopulationSizes in interface islandev.EvolutionaryInteractiveTask

    getSolutionTemplate

    public islandev.Individual getSolutionTemplate()
    return Object of type individual so that we should keep evolving if our current best is smaller than this one using their compareTo method.
    Specified by:
    getSolutionTemplate in interface islandev.EvolutionaryInteractiveTask

    getSnapshotPainter

    public islandev.SnapshotPainter getSnapshotPainter()
    Specified by:
    getSnapshotPainter in interface islandev.EvolutionaryInteractiveTask

    getGenerations

    public int[] getGenerations()
    Sending array itself by reference so could be destroyed.
    Specified by:
    getGenerations in interface islandev.EvolutionaryInteractiveTask
    Following copied from interface: islandev.EvolutionaryInteractiveTask
    Returns:
    Generation number of each of the populations