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, removeChildFunctionsgetName, setNamepublic WeightedScoreFunction(java.lang.String name)
name - The name of this function.public java.lang.String toString()
toString in class AbstractScoreFunctionpublic 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)
CompositeScoreFunctionremoveChildFunction in class CompositeScoreFunctionchild - The child function to remove.public double score(WorldModel<? extends Entity> world, Timestep timestep)
ScoreFunctionworld - The state of the world at the end of the timestep.timestep - The record of perception, commands and changes for the timestep.