Back
/*
 * (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.HashMap;
import java.util.HashSet;

/**
 * The genetic information encoded in <i>Zygothic graph</i> tells, shortly, what <i>Mediators</i>
 * are produced if the neuron is in <i>Cumulative state</i> on a given <i>Mediator</i>. The neuro transmitters
 * are characterised by <i>Zygothic graph</i> allowing to produce themself, ie. <i>A -&gt; A</i>
 */
public class ZygothicGraph
{
    public enum Mediator {
        BLACK, RED, BLUE, CYAN, ORANGE
    }

    private HashMap<Mediator, HashSet<Mediator>> graph;

    public ZygothicGraph() {
        graph = new HashMap<Mediator, HashSet<Mediator>>();
        
        forMediator m : Mediator.values() ) {
            HashSet<Mediator> target = new HashSet<Mediator>();
            target.add);
            graph.putm, target );
        }
        
        addMediator.ORANGE, Mediator.CYAN );
        addMediator.CYAN,   Mediator.BLUE );
    }

    /**
     * Used only by the constructor, if the <i>Zyghotic graph</i> is more complex
     */
    private void addMediator from, Mediator to ) {
        HashSet<Mediator> target = graph.getfrom );
        target.addto );
    }

    /**
     * Returns all mediators produced by neuron in <i>Cumulative state</i> cumulativeState
     */
    public HashSet<Mediator> getProductionMediator cumulativeState ) {
        return graph.get(cumulativeState);
    }
}
Back