com.rubecula.darwin.domain.helper
Class PhenotypeCache
java.lang.Object
com.rubecula.darwin.domain.helper.Cache_<PhenotypeCacheKey,Phenotype>
com.rubecula.darwin.domain.helper.PhenotypeCache
- All Implemented Interfaces:
- Cache, Cache_MBean, net.sf.tostring0.Identifiable
public class PhenotypeCache
- extends Cache_<PhenotypeCacheKey,Phenotype>
This cache maintains a set of Phenotypes indexed by Basic/Identifiable pair.
Normally, the identifiable object is a population, or at any rate, a
Colony
. The purpose is to save time regenerating the phenotype when
it is unnecessary.
TODO must ensure that this cache is flushed when variables change.
- Author:
- Robin Hillyard
Fields inherited from class com.rubecula.darwin.domain.helper.Cache_ |
LOG |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PhenotypeCache
public PhenotypeCache()
addPhenotype
public void addPhenotype(Basic genes,
net.sf.tostring0.Identifiable identifiable,
Phenotype phenotype)
- Parameters:
genes
- the genes being expressedidentifiable
- the identifiable object, typically a population.phenotype
-
flush
public void flush(Basic genes,
net.sf.tostring0.Identifiable identifiable)
- Parameters:
genes
- identifiable
-
getIdentifier
public java.lang.String getIdentifier()
- Returns:
- "phenotype cache"
- See Also:
Identifiable.getIdentifier()
getPhenotype
public Phenotype getPhenotype(Basic genes,
net.sf.tostring0.Identifiable identifiable)
- Parameters:
genes
- the genes from which we derive the phenotypeidentifiable
- the identifiable object (and its environment).
- Returns:
- the cached phenotype (or null if none) - unless it is not active
in which case always null.
Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.