be.optiloading
Class Gui

java.lang.Object
  extended by be.optiloading.Gui

public class Gui
extends java.lang.Object

Gui class creates the main GUI.

Author:
Tim Pintens, info@optiloading.be, www.optiloading.be

Nested Class Summary
(package private)  class Gui.AboutListener
           
(package private)  class Gui.ComboBoxListener
           
(package private)  class Gui.FieldListener
           
(package private)  class Gui.HelpListener
           
(package private)  class Gui.OpenListener
           
(package private)  class Gui.QuitListener
           
(package private)  class Gui.SaveListener
           
(package private)  class Gui.SettingsListener
           
(package private)  class Gui.StartButtonListener
           
 
Field Summary
 MiscComp misccompartments
           
 
Method Summary
 void addLog(java.lang.String add)
          Method to add text to the genetic log.
 void addLogSeparator()
          Method to add a seperator to the log
 Chromosome getBestchrom()
          Method to get the best chromosome.
 float getCargo()
          Method to get the desired cargo or TMD to be achieved.
 float getDensity()
          Method to get the density of the water.
static Gui getInstance()
          Returns the uniqueInstance of the Gui object.
 float getSpecificgravity()
          Method to get the specific gravity of the cargo.
 float getTarget()
          Method to get the desired trim.
 void repaintOptiloading(int gen, float mean)
          Method to repaint the main GUI, if best solution hasn't changed.
 void repaintOptiloading(int gen, float mean, Chromosome best, Ship loadedship)
          Method to repaint the main GUI.
 void setConstants(float dis, float dead, float tmdvalue)
          Method to get update the displacement and deadweight label.
 void showFrame()
          Method uses by the Applet version to show the main frame.
 void stopFinal()
          Method which is calles when an optimal condition has been found
 void updateLabels()
          Method to show if the input values are acceptable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

misccompartments

public MiscComp misccompartments
Method Detail

getInstance

public static Gui getInstance()
Returns the uniqueInstance of the Gui object.

Returns:
Gui object.

showFrame

public void showFrame()
Method uses by the Applet version to show the main frame.


addLog

public void addLog(java.lang.String add)
Method to add text to the genetic log.

Parameters:
add - String containing the text you want to add to the log.

addLogSeparator

public void addLogSeparator()
Method to add a seperator to the log


getCargo

public float getCargo()
Method to get the desired cargo or TMD to be achieved.

Returns:
Floating point value containing the cargo or TMD to be achieved.

setConstants

public void setConstants(float dis,
                         float dead,
                         float tmdvalue)
Method to get update the displacement and deadweight label.

Parameters:
dis - Floating point value that holds the displacement.
dead - Floating point value that holds the deadweight.

getSpecificgravity

public float getSpecificgravity()
Method to get the specific gravity of the cargo.

Returns:
Floating point value containing the specific gravity of the cargo.

getDensity

public float getDensity()
Method to get the density of the water.

Returns:
Floating point value containing the density of the water.

getTarget

public float getTarget()
Method to get the desired trim.

Returns:
Floating point value containing the desired trim.

stopFinal

public void stopFinal()
Method which is calles when an optimal condition has been found


getBestchrom

public Chromosome getBestchrom()
Method to get the best chromosome.

Returns:
Chromosome that holds the best solution.

repaintOptiloading

public void repaintOptiloading(int gen,
                               float mean)
Method to repaint the main GUI, if best solution hasn't changed.

Parameters:
gen - Integer value containing the current generation.
mean - Floating point value containing the mean fitness of the current population.

repaintOptiloading

public void repaintOptiloading(int gen,
                               float mean,
                               Chromosome best,
                               Ship loadedship)
Method to repaint the main GUI.

Parameters:
gen - Integer value containing the current generation.
best - Floating point value containing the fitness of the best solution.
mean - Floating point value containing the mean fitness of the current population.
best - Chromosome object that is the best of its current population.
loadedship - Ship object which contains general ship information.

updateLabels

public void updateLabels()
Method to show if the input values are acceptable.