kernel

## Class AMOEBA

- java.lang.Object
- - java.lang.Thread
  - - kernel.AMOEBA

All Implemented Interfaces:
  java.lang.Runnable

    public class AMOEBA
    extends java.lang.Thread

The Class AMOEBA.

Author:
  nigon

### Nested Class Summary

### Nested classes/interfaces inherited from class java.lang.Thread

`java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

### Field Summary

### Fields inherited from class java.lang.Thread

`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

### Constructor Summary

Constructors
Constructor and Description
`AMOEBA(java.lang.Boolean viewer, Scheduler scheduler, World world, BlackBox blackBox)` Instantiates a new amoeba.
`AMOEBA(StudiedSystem studiedSystem)` Instantiates a new amoeba.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `changeControl()` Change control.
`java.util.ArrayList<Context>` `getAllValidContextBut(java.util.HashMap<java.lang.String,java.lang.Double> values, java.lang.String s)` Gets the all valid context but.
`java.util.ArrayList<Context>` `getAllValidContextBut(java.lang.String s)` Gets the all valid context but.
`boolean` `getCSV()` Gets the csv.
`CsvFileWriter` `getCSVFile()` Gets the CSV file.
`LearningProvider` `getLearningProvider()` Gets the learning provider.
`LogFile` `getLogFile()` Gets the log file.
`MainPanel` `getMainPanel()` Gets the main panel.
`Scheduler` `getScheduler()` Gets the scheduler.
`StudiedSystem` `getStudiedSystem()` Gets the studied system.
`TemporalGraph` `getTemporalGraph()` Gets the temporal graph.
`boolean` `isRunning()` Checks if is running.
`void` `learn(java.util.HashMap<java.lang.String,java.lang.Double> actions)` Learn.
`void` `playOneStep()` Play one step.
`void` `readInput()` Read input.
`double` `request(java.util.HashMap<java.lang.String,java.lang.Double> actions)` Request.
`void` `run()`
`void` `setAVT_acceleration(double aVT_acceleration)` Sets the AV T acceleration.
`void` `setAVT_deceleration(double aVT_deceleration)` Sets the AV T deceleration.
`void` `setAVT_percentAtStart(double aVT_percentAtStart)` Sets the AV T percent at start.
`void` `setDataForErrorMargin(double errorAllowed, double augmentationFactorError, double diminutionFactorError, double minErrorAllowed, int nConflictBeforeAugmentation, int nSuccessBeforeDiminution)` Sets the data for error margin.
`void` `setDataForInexactMargin(double inexactAllowed, double augmentationInexactError, double diminutionInexactError, double minInexactAllowed, int nConflictBeforeInexactAugmentation, int nSuccessBeforeInexactDiminution)` Sets the data for inexact margin.
`void` `setGenerateCSV(boolean csv)` Sets the generate CSV.
`void` `setLocalModel(TypeLocalModel model)` Sets the local model.
`void` `setRememberState(boolean rememberState)` Sets the remember state.
`void` `setRunning(boolean running)` Sets the running.
`void` `setScheduler(Scheduler scheduler)` Sets the scheduler.
`void` `setStudiedSystem(StudiedSystem studiedSystem)` Sets the studied system.
`void` `start()`
`void` `start(boolean running)` Start.

### Methods inherited from class java.lang.Thread

`activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### AMOEBA

    public AMOEBA(StudiedSystem studiedSystem)

Instantiates a new amoeba.

Parameters:
  `studiedSystem` - the studied system

#### AMOEBA

    public AMOEBA(java.lang.Boolean viewer,
                  Scheduler scheduler,
                  World world,
                  BlackBox blackBox)

Instantiates a new amoeba.

Parameters:
  `viewer` - the viewer
  `scheduler` - the scheduler
  `world` - the world
  `blackBox` - the black box

### Method Detail

#### setDataForErrorMargin

    public void setDataForErrorMargin(double errorAllowed,
                                      double augmentationFactorError,
                                      double diminutionFactorError,
                                      double minErrorAllowed,
                                      int nConflictBeforeAugmentation,
                                      int nSuccessBeforeDiminution)

Sets the data for error margin.

Parameters:
  `errorAllowed` - the error allowed
  `augmentationFactorError` - the augmentation factor error
  `diminutionFactorError` - the diminution factor error
  `minErrorAllowed` - the min error allowed
  `nConflictBeforeAugmentation` - the n conflict before augmentation
  `nSuccessBeforeDiminution` - the n success before diminution

#### setDataForInexactMargin

    public void setDataForInexactMargin(double inexactAllowed,
                                        double augmentationInexactError,
                                        double diminutionInexactError,
                                        double minInexactAllowed,
                                        int nConflictBeforeInexactAugmentation,
                                        int nSuccessBeforeInexactDiminution)

Sets the data for inexact margin.

Parameters:
  `inexactAllowed` - the inexact allowed
  `augmentationInexactError` - the augmentation inexact error
  `diminutionInexactError` - the diminution inexact error
  `minInexactAllowed` - the min inexact allowed
  `nConflictBeforeInexactAugmentation` - the n conflict before inexact augmentation
  `nSuccessBeforeInexactDiminution` - the n success before inexact diminution

#### setLocalModel

    public void setLocalModel(TypeLocalModel model)

Sets the local model.

Parameters:
  `model` - the new local model

#### start

    public void start(boolean running)

Start.

Parameters:
  `running` - the running

#### run

    public void run()

Specified by:
  `run` in interface `java.lang.Runnable`
Overrides:
  `run` in class `java.lang.Thread`

#### learn

    public void learn(java.util.HashMap<java.lang.String,java.lang.Double> actions)

Learn.

Parameters:
  `actions` - the actions

#### request

    public double request(java.util.HashMap<java.lang.String,java.lang.Double> actions)

Request.

Parameters:
  `actions` - the actions
Returns:
  the double

#### start

    public void start()

Overrides:
  `start` in class `java.lang.Thread`

#### getScheduler

    public Scheduler getScheduler()

Gets the scheduler.

Returns:
  the scheduler

#### readInput

    public void readInput()

Read input.

#### setScheduler

    public void setScheduler(Scheduler scheduler)

Sets the scheduler.

Parameters:
  `scheduler` - the new scheduler

#### isRunning

    public boolean isRunning()

Checks if is running.

Returns:
  true, if is running

#### setRunning

    public void setRunning(boolean running)

Sets the running.

Parameters:
  `running` - the new running

#### playOneStep

    public void playOneStep()

Play one step.

#### changeControl

    public void changeControl()

Change control.

#### getAllValidContextBut

    public java.util.ArrayList<Context> getAllValidContextBut(java.lang.String s)

Gets the all valid context but.

Parameters:
  `s` - the s
Returns:
  the all valid context but

#### getAllValidContextBut

    public java.util.ArrayList<Context> getAllValidContextBut(java.util.HashMap<java.lang.String,java.lang.Double> values,
                                                              java.lang.String s)

Gets the all valid context but.

Parameters:
  `values` - the values
  `s` - the s
Returns:
  the all valid context but

#### getStudiedSystem

    public StudiedSystem getStudiedSystem()

Gets the studied system.

Returns:
  the studied system

#### setStudiedSystem

    public void setStudiedSystem(StudiedSystem studiedSystem)

Sets the studied system.

Parameters:
  `studiedSystem` - the new studied system

#### getMainPanel

    public MainPanel getMainPanel()

Gets the main panel.

Returns:
  the main panel

#### getLearningProvider

    public LearningProvider getLearningProvider()

Gets the learning provider.

Returns:
  the learning provider

#### getLogFile

    public LogFile getLogFile()

Gets the log file.

Returns:
  the log file

#### getTemporalGraph

    public TemporalGraph getTemporalGraph()

Gets the temporal graph.

Returns:
  the temporal graph

#### setRememberState

    public void setRememberState(boolean rememberState)

Sets the remember state.

Parameters:
  `rememberState` - the new remember state

#### setGenerateCSV

    public void setGenerateCSV(boolean csv)

Sets the generate CSV.

Parameters:
  `csv` - the new generate CSV

#### getCSV

    public boolean getCSV()

Gets the csv.

Returns:
  the csv

#### getCSVFile

    public CsvFileWriter getCSVFile()

Gets the CSV file.

Returns:
  the CSV file

#### setAVT_acceleration

    public void setAVT_acceleration(double aVT_acceleration)

Sets the AV T acceleration.

Parameters:
  `aVT_acceleration` - the new AV T acceleration

#### setAVT_deceleration

    public void setAVT_deceleration(double aVT_deceleration)

Sets the AV T deceleration.

Parameters:
  `aVT_deceleration` - the new AV T deceleration

#### setAVT_percentAtStart

    public void setAVT_percentAtStart(double aVT_percentAtStart)

Sets the AV T percent at start.

Parameters:
  `aVT_percentAtStart` - the new AV T percent at start