Documentation of 'org.jgap.CachedFitnessFunction' Java class
CachedFitnessFunction
org.jgap

Class CachedFitnessFunction

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, ICloneable


    public abstract class CachedFitnessFunction
    extends FitnessFunction
    The cached fitness function extends the original FitnessFunction functionality in order to reduce evaluating something twice.
    Since:
    3.2
    See Also:
    Serialized Form
    • Constructor Detail

      • CachedFitnessFunction

        public CachedFitnessFunction()
        Default Constructor ensuring downward compatibility.
        Since:
        3.3.2
      • CachedFitnessFunction

        public CachedFitnessFunction(java.util.Map<java.lang.String,java.lang.Double> cache)
        Constructor that allows to use a custom java.util.Map implementation as cache.
        E.g. for multi-threaded fitness calculations one could use one instance of java.util.concurrent.ConcurrentHashMap for all instances of the fitness function.
        Parameters:
        cache - java.util.Map data structure used to cache the fitness values
        Since:
        3.3.2
    • Method Detail

      • getFitnessValue

        public final double getFitnessValue(IChromosome a_subject)
        Cached fitness value function.
        Overrides:
        getFitnessValue in class FitnessFunction
        Parameters:
        a_subject - the chromosome to evaluate
        Returns:
        fitness value, from cache if available
        Since:
        3.2

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.