Contents
Class Evaluator<OptionType extends Option>
java.lang.Object
com.hypixel.hytale.server.npc.decisionmaker.core.Evaluator<OptionType>
- Direct Known Subclasses:
CombatActionEvaluator, StateEvaluator
The evaluator which selects the desired
Option based on utility.
Evaluators automatically reject any option with 0 utility and can be set to run with a minimum utility value each execution. Any options falling beneath this value will also be ignored.
A predictability value between 0-1 can also be defined. With maximum predictability, the NPC will always choose the option with the highest utility. Decreasing the predictability allows a gradually wider range of less optimal options to be selected, using the utility values as weights in the selection.
Inspired by the Infinite Axis Utility System.
- Since:
- 2019/12/03
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(int index, ArchetypeChunk<EntityStore> archetypeChunk, CommandBuffer<EntityStore> commandBuffer, EvaluationContext context) voidvoidsetupNPC(Holder<EntityStore> holder) This method handles initialisation of any parts of the evaluator that require access to external components.voidsetupNPC(ExecutionSupport executionSupport) This method should be called within the position cache initialisation when an NPC is instantiated and handles initialising values on the NPC itself so that it can register, compute, and pass relevant data to the conditions for evaluation.
-
Field Details
-
LOGGER
-
NOT_USED
public static long NOT_USED
-
-
Constructor Details
-
Evaluator
public Evaluator()
-
-
Method Details
-
initialise
public void initialise() -
setupNPC
This method should be called within the position cache initialisation when an NPC is instantiated and handles initialising values on the NPC itself so that it can register, compute, and pass relevant data to the conditions for evaluation. -
setupNPC
This method handles initialisation of any parts of the evaluator that require access to external components.- Parameters:
holder- the holder for the NPC
-
evaluate
@Nullable public Evaluator<OptionType>.OptionHolder evaluate(int index, @Nonnull ArchetypeChunk<EntityStore> archetypeChunk, CommandBuffer<EntityStore> commandBuffer, @Nonnull EvaluationContext context)
-