evolution
Class EvolutionKnowledgeCatalog

evolution.KnowledgeCatalog
  |
  +--evolution.EvolutionKnowledgeCatalog

public class EvolutionKnowledgeCatalog
extends KnowledgeCatalog

The general Evolution KnowledgeCatalog.

Stereotype singleton

Field Summary
 protected static EvolutionKnowledgeCataloginstance
          Instance of the singleton.

Constructor Summary
 protected EvolutionKnowledgeCatalog(String fileName)
          Create a new KnowledgeCatalog from the given file.

Method Summary
 doublecalcGoal(Map resources)
          Calculate the current goal from a list of given resources.
 doublegetCreationIncrease()
          Return the amount by which the player's creationpower increases on every clocktick.
 intgetDefaultVisionRange()
          Return the default vision range.
 doublegetHumanCreationDecrease()
          Return the amount by which the player's creationpower decreases whenever he creates a human.
 doublegetInitCreationPower()
          Return the initial creationpower of a player.
 static EvolutionKnowledgeCataloggetInst()
          Return the instance of this singleton.
 doublegetMaxCreationPower()
          Return the maximum amount of creationpower.
 static voidinitialize(String fileName)
          Initialize this singleton from the given file.
 protected voidparseWeights(String weightsString)
          Parse the weightsline for the goal from the config file.

Methods inherited from class evolution.KnowledgeCatalog
dlClassForName, extractArgument, extractName, extractValue, getFileName, getProperty, getProperty, getResourcePath, isInitialized, makeStringDoubleMap, setResourcePath, split, stripPathFromClassName, stripPathFromClassName, stripPathFromClassName

Field Detail

instance

protected static EvolutionKnowledgeCatalog instance
Instance of the singleton.
Constructor Detail

EvolutionKnowledgeCatalog

protected EvolutionKnowledgeCatalog(String fileName)
throws java.io.IOException,
java.io.FileNotFoundException
Create a new KnowledgeCatalog from the given file.
Method Detail

calcGoal

public double calcGoal(Map resources)
Calculate the current goal from a list of given resources.
precondition The list must contain all resources for which weight values are read from the config file.

getCreationIncrease

public double getCreationIncrease()
Return the amount by which the player's creationpower increases on every clocktick.

getDefaultVisionRange

public int getDefaultVisionRange()
Return the default vision range.

getHumanCreationDecrease

public double getHumanCreationDecrease()
Return the amount by which the player's creationpower decreases whenever he creates a human.

getInitCreationPower

public double getInitCreationPower()
Return the initial creationpower of a player.

getInst

public static EvolutionKnowledgeCatalog getInst()
Return the instance of this singleton.

getMaxCreationPower

public double getMaxCreationPower()
Return the maximum amount of creationpower.

initialize

public static void initialize(String fileName)
throws java.io.FileNotFoundException,
java.io.IOException
Initialize this singleton from the given file.

parseWeights

protected void parseWeights(String weightsString)
Parse the weightsline for the goal from the config file. This line looks like this: Goal = Happiness(5) Energy(4) Coals(6.5) The weights will be normalized so they sum to 1.

Association Links

to Class java.util.Map

Hash of Class objects for resources and their normalized weight.

to Class evolution.EvolutionKnowledgeCatalog

Instance of the singleton.

a gvijf production