/*
* (C) 2003-2009 Spolecne s.r.o.
* Author: Tomas Straka
* www.spoledge.com
*
* Written permission must be obtained in advance from Spolecne s.r.o for any form of
* reproduction, use or distribution.
*/
package ants.models.thrakia;
import java.util.Set;
import ants.models.thrakia.ZygothicGraph.Mediator;
/**
* Fire Law says: When a neuron catches mediators, later it fires mediators too.
* The type (and quantity) of fired mediators dependends on internal state of the neuron
* and genetic information identical for all simulated cells.
*/
public class FireLaw
{
/**
* This constant represents <i>Lately</i>. See "The introduction to the neural networks"
* for the exact definition. It means how often a neuron can fire.
*/
private static final double tm = 0.01;
/**
* This constant represents <i>In a moment</i>. See "The introduction to the neural networks"
* for the exact definition. It means how long it takes to transfer the signal through a neuron.
*/
private static final double te = 0.001;
/**
* The internal representation of the genetic information, see <i>Zyghothic graph</i> in
* "The introduction to the neural networks"
*/
private static ZygothicGraph graph = new ZygothicGraph();
/**
* The logic which determines if the neuron will fire
*/
public static boolean fireCanBeTriggered(double time, double lastFire) {
return lastFire + tm < time;
}
/**
* The logic which determines when the neuron will fire. Returns relative time.
*/
public static double whenToFire() {
return te;
}
/**
* The logic which determines what are the produced <i>Mediators</i>. The logic is
* dependent on <i>Cumulative State</i> of the neuron and genetic information.
*/
public static Set<Mediator> whatToFire(Mediator cumulativeState) {
return graph.getProduction( cumulativeState );
}
/**
* Returns minimal interval between fires
*/
public static double getMinInterval() {
return tm;
}
}
|