You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Action(Color.BLUE, ActionType.MARITIME_TRADE, ("WOOD", "WOOD", None, None, "SHEEP")) # 2 woods for a sheep
Action(Color.BLUE, ActionType.MARITIME_TRADE, ("BRICK", "BRICK", "BRICK", "BRICK", "WHEAT")) # 4 bricks for a wheat
Seems better to encode these as a union of two "freqdecks". This will make it more vector-friendl, potentially faster, and more interoperable with the rest of the code.
Action(Color.BLUE, ActionType.MARITIME_TRADE, (2,0,0,0,0,0,0,1,0,0)) # 2 woods for a sheep
Action(Color.BLUE, ActionType.MARITIME_TRADE, (0,4,0,0,0,0,0,0,1,0)) # 4 bricks for a wheat
The text was updated successfully, but these errors were encountered:
Ahh, that makes sense. I think I am mixing the end-goal with the current state of things. I think at the current state of things your suggestion makes sense.
However, more and more it seems we want to keep de-adopting Python high-level objects (including enums) in favor of more primitive data types because of performance. Particularly, this action might actually become something like:
(1,8,2,0,0,0,0,0,0,1,0,0)
in the future, where 1 means Blue, 8 means Maritime Trade, and such. That should make .copy() methods of the state much faster. Ideally, the complete state is just a vector we can quickly copy and edit by convention (i.e. index 5 is number of houses for second player, ...); for speed.
zarns
linked a pull request
Nov 3, 2024
that will
close
this issue
Right now trade actions look like:
Seems better to encode these as a union of two "freqdecks". This will make it more vector-friendl, potentially faster, and more interoperable with the rest of the code.
The text was updated successfully, but these errors were encountered: