public class WeightedScoreFunction extends CompositeScoreFunction
children
Constructor and Description |
---|
WeightedScoreFunction(java.lang.String name)
Create a WeightedScoreFunction with no children.
|
Modifier and Type | Method and Description |
---|---|
void |
addChildFunction(ScoreFunction child,
double weight)
Add a child score function with a weight.
|
void |
removeChildFunction(ScoreFunction child)
Remove a child score function.
|
double |
score(WorldModel<? extends Entity> world,
Timestep timestep)
Calculate the score for a timestep.
|
java.lang.String |
toString() |
addChildFunction, addChildFunctions, addChildFunctions, getChildFunctions, initialise, removeChildFunctions, removeChildFunctions
getName, setName
public WeightedScoreFunction(java.lang.String name)
name
- The name of this function.public java.lang.String toString()
toString
in class AbstractScoreFunction
public void addChildFunction(ScoreFunction child, double weight)
child
- The child score function to add.weight
- The weight of this child function.public void removeChildFunction(ScoreFunction child)
CompositeScoreFunction
removeChildFunction
in class CompositeScoreFunction
child
- The child function to remove.public double score(WorldModel<? extends Entity> world, Timestep timestep)
ScoreFunction
world
- The state of the world at the end of the timestep.timestep
- The record of perception, commands and changes for the timestep.