I was hoping to attempt creating a bot to automatically play a video game, and was wondering if Optaplanner could be used for task planning for the bot.
The bot has a starting state, desired end state, and different tasks it can perform. The goal would be to use optaplanner to find a viable sequence of Tasks to make the bot go from the starting state to the desired end state, optimizing to be lowest cost.
Bot:
- State:
- items in inventory
- current location
Task:
- examples: gather 1 wood, craft a bucket
- each task has "requirements" on the current state -- f(currentState) -> boolean
- a task transitions the bot to a new state -- f(currentState) -> newState
- has a cost heuristic: f(currentState) -> int
- tasks can be repeated. For example, the bot may need to gather 5 wood (gather wood task, repeated 5 times)
- tasks might go unused. For example, if the desired end state is to have a metal bucket, there is no need to perform the gather wood task.
Is this possible with Optaplanner? What is the correct way to model this problem?
Any assistance/guidance would be appreciated, I've combed through most of the Optaplanner documentation and examples already.
I've looked into @PlanningListVariable, but I'm not sure this fits my use case. The docs say:
Each planning value is assigned to exactly one planning entity.
In my case, the Task would be the planning value, and the Bot would be the planning entity (?). But, many Tasks might be unused and should not be assigned at all... so it doesn't seem correct.