/*
 * Created on Nov 16, 2003
 * $Id: Parameters.java,v 1.11 2003/11/26 22:30:37 vlad Exp $
 */
package Organisms2.g6;

import java.awt.Color;

/**
 * @author Vladislav
 * @version $Revision: 1.11 $
 */
public class Parameters {
	
	public static final int kDefaultRole = 200;
	public static final int kExpansionPeriod = 160;
	public static final Color kDefaultColor = new Color(1.0f,0.5f,1.0f); 
	
	private static final Parameters[] roles = new Parameters[256];

	static {		
		double increment = 1.0 / (double)roles.length;
		double energy;
		
		for (int i=0; i<roles.length; i++) {
			roles[i] = new Parameters();
			
			energy = increment * (double)i;
			roles[i].setMinDivideEnergy(energy);
			
			if (energy < 0.33) {
				roles[i].setColor(kDefaultColor.brighter());
			} else if (energy > 0.66) {
				roles[i].setColor(kDefaultColor.darker());
			} else {
				roles[i].setColor(kDefaultColor);
			}
		}
	}
	
	public static Parameters forRole(int role) {
		return roles[role];
	}
	
	public static int numRoles() {
		return roles.length;
	}
	
	protected double minDivideEnergy = 0.4;
	protected int maxChildren = 1000;
	protected double exploreProbability = 0;
	protected int greediness = 1;
	protected int behaviour = 0;
	protected Color color = kDefaultColor;
	protected int amortizedMoveCost = 2;
	
	/**
	 * @return Returns the exploreProbability.
	 */
	public double getExploreProbability() {
		return exploreProbability;
	}
	/**
	 * @param exploreProbability The exploreProbability to set.
	 */
	private void setExploreProbability(double exploreProbability) {
		this.exploreProbability = exploreProbability;
	}
	/**
	 * @return Returns the greediness.
	 */
	public int getGreediness() {
		return greediness;
	}
	/**
	 * @param greediness The greediness to set.
	 */
	private void setGreediness(int greediness) {
		this.greediness = greediness;
	}
	/**
	 * @return Returns the maxChildren.
	 */
	public int getMaxChildren() {
		return maxChildren;
	}
	/**
	 * @param maxChildren The maxChildren to set.
	 */
	private void setMaxChildren(int maxChildren) {
		this.maxChildren = maxChildren;
	}
	
	/**
	 * @return Returns the behaviour.
	 */
	public int getBehaviour() {
		return behaviour;
	}
	/**
	 * @param behaviour The behaviour to set.
	 */
	private void setBehaviour(int behaviour) {
		this.behaviour = behaviour;
	}
	
	/**
	 * @param minDivideEnergy The minDivideEnergy to set.
	 */
	private void setMinDivideEnergy(double minDivideEnergy) {
		this.minDivideEnergy = minDivideEnergy;
	}
	
	/**
	 * @return Returns the minDivideEnergy.
	 */
	public double getMinDivideEnergy() {
		return minDivideEnergy;
	}
	
	/**
	 * @return Returns the color.
	 */
	public Color getColor() {
		return color;
	}
	
	/**
	 * @param color The color to set.
	 */
	private void setColor(Color color) {
		this.color = color;
	}
	
	/**
	 * @return Returns the amortizedMoveCost.
	 */
	public int getAmortizedMoveCost() {
		return amortizedMoveCost;
	}
	
	/**
	 * @param amortizedMoveCost The amortizedMoveCost to set.
	 */
	private void setAmortizedMoveCost(int amortizedMoveCost) {
		this.amortizedMoveCost = amortizedMoveCost;
	}
}
