Hi !
Iām 6th Legend with deep search algorithm.
It was a funny and great contest, i loved it!
Here is the pseudo algorithm of my solution.
(Please forgive my poor english grammar, i know my weakness :/).
Each Turn :
1- I remove the customer order more near from the other botās dish (if have one with at least one item).
1b- If an order is removed, i add the next customer order from the full order list to the current list.
2- From the current order list, take the one (or more if theyāve equals esimtations) wich have the next task more near to me (the most profitable).
(Next task can is : make an item, assemble the dish or deliver it).
Set the root node to the current kitchen state.
While have time (50ms) :
Build all actions from the current node state. Actions are, all moves 1-4 tiles from my position, all uses just next to me (3x3 tiles), one drop (the table beetween me and other bot), and wait.
There is 10-15 moves average in a game for a kitchen state.
For all actions :
- Make the kitchen in the good state (play the action, or play all parents actions if deph is greater than one).
- Evaluate action for each order in the current order list (see point 2) with an heuristic function. Itās based on distance (real, not manhattan), checklist of recipe, items already crafted etc ā¦
- If Evaluation is more lower than others (lower because evaluation is mainly distances), keep it.
The cooperation is practiced with the drop item action wich can produce good values corresponding to bots positions.
- Reverse all actions on current node.
If iāve evaluate all actions of the current depth, go to the next depth.
The next depth is a new action for me, not the other bot action. Itās like i consider the other bot play only WAIT.
At the end of time, play the best move in depth 1.
My code be able to see depth 3-4, it depends on situations. So, my bot can takes shortcut for build the dish for exemple.
At the end of contest, i had a better oven management, plates counter, littles rectifications, etc ā¦
Concerning codeās architecture, i have an asbract Action with two mains methods [play(Chief, Kitchen) and inverse(Chief, Kithen)] for browse the game tree, and multiples extended actions likes MoveAction, OvenAction, DishWasherAction, DropAction, etc ā¦
Itās all
Thanks to csj and Matteh for they job !
Thomas.