org.opt4j.viewer
Class PopulationWidget

java.lang.Object
  extended by org.opt4j.viewer.PopulationWidget
All Implemented Interfaces:
org.opt4j.core.IndividualSetListener, org.opt4j.core.IndividualStateListener, ObjectivesMonitor.ObjectivesListener, Widget

public class PopulationWidget
extends java.lang.Object
implements org.opt4j.core.IndividualStateListener, org.opt4j.core.IndividualSetListener, Widget, ObjectivesMonitor.ObjectivesListener

A widget that monitors the Population.


Nested Class Summary
protected  class PopulationWidget.Model
          The PopulationWidget.Model.
protected  class PopulationWidget.Table
          The PopulationWidget.Table.
 
Field Summary
protected  org.opt4j.core.optimizer.Archive archive
           
protected  java.util.List<org.opt4j.core.Objective> objectives
           
protected static int OFFSET
           
protected  javax.swing.JPanel panel
           
protected  org.opt4j.viewer.SynchronizedIndividualList population
           
protected  int size
           
protected  java.util.List<org.opt4j.core.Individual> swtIndividuals
           
protected  javax.swing.JTable table
           
protected  org.opt4j.core.config.visualization.DelayTask task
           
 
Constructor Summary
PopulationWidget(org.opt4j.core.optimizer.Population population, org.opt4j.core.optimizer.Archive archive, org.opt4j.core.IndividualFactory individualFactory, ObjectivesMonitor objectivesMonitor)
          Constructs a PopulationWidget.
 
Method Summary
 javax.swing.JPanel getPanel()
          Returns the panel with the content.
protected  javax.swing.JTable getTable()
           
 void individualAdded(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual)
           
 void individualRemoved(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual)
           
 void inidividualStateChanged(org.opt4j.core.Individual individual)
           
 void init(Viewport viewport)
          Called once after the widget is added to the Viewport.
 void objectives(java.util.Collection<org.opt4j.core.Objective> obj)
          Callback method that passes the objectives of the optimization problem.
protected  void paint()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OFFSET

protected static final int OFFSET
See Also:
Constant Field Values

archive

protected final org.opt4j.core.optimizer.Archive archive

population

protected final org.opt4j.viewer.SynchronizedIndividualList population

swtIndividuals

protected java.util.List<org.opt4j.core.Individual> swtIndividuals

objectives

protected final java.util.List<org.opt4j.core.Objective> objectives

panel

protected final javax.swing.JPanel panel

table

protected final javax.swing.JTable table

size

protected int size

task

protected final org.opt4j.core.config.visualization.DelayTask task
Constructor Detail

PopulationWidget

@Inject
public PopulationWidget(org.opt4j.core.optimizer.Population population,
                               org.opt4j.core.optimizer.Archive archive,
                               org.opt4j.core.IndividualFactory individualFactory,
                               ObjectivesMonitor objectivesMonitor)
Constructs a PopulationWidget.

Parameters:
population - the population
archive - the archive
individualFactory - the individual creator
objectivesMonitor - the objective monitor that determine the objective of the optimization problem
Method Detail

getTable

protected final javax.swing.JTable getTable()

init

public void init(Viewport viewport)
Description copied from interface: Widget
Called once after the widget is added to the Viewport.

Specified by:
init in interface Widget
Parameters:
viewport - the base viewport

inidividualStateChanged

public void inidividualStateChanged(org.opt4j.core.Individual individual)
Specified by:
inidividualStateChanged in interface org.opt4j.core.IndividualStateListener

individualAdded

public void individualAdded(org.opt4j.core.IndividualSet collection,
                            org.opt4j.core.Individual individual)
Specified by:
individualAdded in interface org.opt4j.core.IndividualSetListener

individualRemoved

public void individualRemoved(org.opt4j.core.IndividualSet collection,
                              org.opt4j.core.Individual individual)
Specified by:
individualRemoved in interface org.opt4j.core.IndividualSetListener

paint

protected void paint()

getPanel

public javax.swing.JPanel getPanel()
Description copied from interface: Widget
Returns the panel with the content.

Specified by:
getPanel in interface Widget
Returns:
the panel with the content

objectives

public void objectives(java.util.Collection<org.opt4j.core.Objective> obj)
Description copied from interface: ObjectivesMonitor.ObjectivesListener
Callback method that passes the objectives of the optimization problem.

Specified by:
objectives in interface ObjectivesMonitor.ObjectivesListener
Parameters:
obj - the objectives