physis.core
Class Merit

java.lang.Object
  |
  +--physis.core.Merit

public class Merit
extends java.lang.Object

It's the merit of the digital organism. It's earned by counting the executed or copied instructions and multiplied this number with the bonuses.
CRC
1. Storing the organism's merit value.
2. Calculating the fitness value with as a function of gestation time.


Field Summary
private  double bonusmultiplier
           
private  int effectivelength
           
 
Constructor Summary
Merit()
           
 
Method Summary
 double calculateFitness(int gestation_time)
          Fitness is calculated by the merit divided by the gestation time.
 double getBonusMultiplier()
           
 int getEffectiveLength()
           
 int getMeritValue()
          Merit equals the effective length multipled by the bonuses.
 void multiplyBonus(double bonus_multiplier)
          Multiplies bonus multiplier.
 void setBonusMultiplier(double bonus_multiplier)
          Sets the bonus multiplier.
 void setEffectiveLength(int effective_length)
          Sets the effective length.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

bonusmultiplier

private double bonusmultiplier

effectivelength

private int effectivelength
Constructor Detail

Merit

public Merit()
Method Detail

calculateFitness

public double calculateFitness(int gestation_time)
Fitness is calculated by the merit divided by the gestation time.

getMeritValue

public int getMeritValue()
Merit equals the effective length multipled by the bonuses.

setEffectiveLength

public void setEffectiveLength(int effective_length)
Sets the effective length. After updates it should be updated and when proliferating.

getEffectiveLength

public int getEffectiveLength()

setBonusMultiplier

public void setBonusMultiplier(double bonus_multiplier)
Sets the bonus multiplier.

multiplyBonus

public void multiplyBonus(double bonus_multiplier)
Multiplies bonus multiplier. It should happen only after task completition.

getBonusMultiplier

public double getBonusMultiplier()