jaga.pj.circuits.experiment
Class AddClockExperiment

java.lang.Object
  |
  +--jaga.pj.circuits.experiment.AddClockExperiment
All Implemented Interfaces:
Experiment, java.io.Serializable
Direct Known Subclasses:
AddClockCRIExperiment

public class AddClockExperiment
extends java.lang.Object
implements Experiment

Adds an extra input to the nested experiments generated input which behaves thus: Oscillates cyclesPerSample times starting high and ending low. The input sample separation used must be divisible by 2 * cyclesPerSample.

See Also:
Serialized Form

Constructor Summary
AddClockExperiment(Experiment exp)
          Creates a new instance of AddClockExperiment
AddClockExperiment(Experiment exp, int cyclesPerSample)
           
 
Method Summary
 SampleData[] generateInput()
          generates an array of inputs suitable for this experiment using default input sample separation.
 SampleData[] generateInput(int inputSampleSeparation)
          generates an array of inputs suitable for this experiment.
 double getFitness(SampleData[] in, SampleData[] out)
          returns a fitness associated to a given input/output pair for this experiment.
 int getNumOfInputs()
           
 int getNumOfOutputs()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddClockExperiment

public AddClockExperiment(Experiment exp,
                          int cyclesPerSample)

AddClockExperiment

public AddClockExperiment(Experiment exp)
Creates a new instance of AddClockExperiment
Method Detail

generateInput

public SampleData[] generateInput()
generates an array of inputs suitable for this experiment using default input sample separation.
Specified by:
generateInput in interface Experiment

generateInput

public SampleData[] generateInput(int inputSampleSeparation)
generates an array of inputs suitable for this experiment.
Specified by:
generateInput in interface Experiment
Parameters:
inputSampleSeparation - relative frequency of input to output samples. If this is n, then n outputs will be sampled for every change in inputs.

getFitness

public double getFitness(SampleData[] in,
                         SampleData[] out)
returns a fitness associated to a given input/output pair for this experiment. The fitness is a double and is in adjusted fitness format. From 0 to 1, 1 being perfectly fit.
Specified by:
getFitness in interface Experiment
Parameters:
in - array of inputs
out - array of outputs

getNumOfInputs

public int getNumOfInputs()
Specified by:
getNumOfInputs in interface Experiment

getNumOfOutputs

public int getNumOfOutputs()
Specified by:
getNumOfOutputs in interface Experiment

toString

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