graph-games-proto 0.3.1748__py3-none-any.whl → 0.3.1755__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- graph_games_proto/__init__.py +1 -1
- graph_games_proto/fns.py +39 -102
- {graph_games_proto-0.3.1748.dist-info → graph_games_proto-0.3.1755.dist-info}/METADATA +1 -1
- graph_games_proto-0.3.1755.dist-info/RECORD +9 -0
- graph_games_proto-0.3.1748.dist-info/RECORD +0 -9
- {graph_games_proto-0.3.1748.dist-info → graph_games_proto-0.3.1755.dist-info}/WHEEL +0 -0
- {graph_games_proto-0.3.1748.dist-info → graph_games_proto-0.3.1755.dist-info}/top_level.txt +0 -0
graph_games_proto/__init__.py
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
# __init__.py
|
2
2
|
from .main import hello
|
3
|
-
from .fns import get_deadlines, get_longest_path_length, get_max_allotted_times, get_legal_actions_for_path, find_player_with_longest_path, calc_player_graph, get_edges, FrozenDek, QValueLearningPolicy, Action2, getnextstate2, isactionlegal2, LegalAction, AltAction, Fig, RandoPolicy, StaticBoardConfig, autoplay, getpublicstate, generate_cards, PublicState, State, PlayerInfo, Action, Fig, get_imagined_state, getprivatescore, get_qvalue_trajectories, getnextaction, PlayerState, initfig, getavailablepathstatuses, initboardconfig, gettoplay, getlegalactionspecsforplayer,
|
3
|
+
from .fns import get_deadlines, get_longest_path_length, get_max_allotted_times, get_legal_actions_for_path, find_player_with_longest_path, calc_player_graph, get_edges, FrozenDek, QValueLearningPolicy, Action2, getnextstate2, isactionlegal2, LegalAction, AltAction, Fig, RandoPolicy, StaticBoardConfig, autoplay, getpublicstate, generate_cards, PublicState, State, PlayerInfo, Action, Fig, get_imagined_state, getprivatescore, get_qvalue_trajectories, getnextaction, PlayerState, initfig, getavailablepathstatuses, initboardconfig, gettoplay, getlegalactionspecsforplayer, getpathstatus, printstate, getinitialstate, Card, PrivateState, getprivatestate, printaction, json_serializer, getrng, FrozenBoardConfig, initgameconfig, GameConfig
|
graph_games_proto/fns.py
CHANGED
@@ -1008,7 +1008,6 @@ class ActionDrawUnit:
|
|
1008
1008
|
# struct PublicState
|
1009
1009
|
# fig::Fig
|
1010
1010
|
# logged_game_uuid::UUID
|
1011
|
-
# action_history::Vector{Action}
|
1012
1011
|
# to_play::Vector{Int}
|
1013
1012
|
# num_route_cards::Int
|
1014
1013
|
# num_route_discards::Int
|
@@ -1020,8 +1019,6 @@ class ActionDrawUnit:
|
|
1020
1019
|
# captured_points::Vector{CapturedPoint}
|
1021
1020
|
# last_to_play::Union{Nothing,Int}
|
1022
1021
|
# terminal::Bool
|
1023
|
-
# longest_trail_player_idxs::Vector{Int}
|
1024
|
-
# most_clusters_player_idxs::Vector{Int}
|
1025
1022
|
# winners::Vector{Int}
|
1026
1023
|
# market_refills::Vector{MarketRefill}
|
1027
1024
|
|
@@ -2008,11 +2005,13 @@ class Segment2(PClass):
|
|
2008
2005
|
class Path2(PClass):
|
2009
2006
|
uuid = field(type=str)
|
2010
2007
|
idx = field(type=int)
|
2008
|
+
edge_uuid = field(type=str)
|
2011
2009
|
segments = field(type=list) # List[Segment]
|
2012
2010
|
def __todict__(self):
|
2013
2011
|
return {
|
2014
2012
|
"uuid": self.uuid,
|
2015
2013
|
"idx": self.idx,
|
2014
|
+
"edge_uuid": self.edge_uuid,
|
2016
2015
|
"segments": [segment.__todict__() for segment in self.segments],
|
2017
2016
|
}
|
2018
2017
|
@staticmethod
|
@@ -2020,6 +2019,7 @@ class Path2(PClass):
|
|
2020
2019
|
return Path2(
|
2021
2020
|
uuid=d["uuid"],
|
2022
2021
|
idx=d["idx"],
|
2022
|
+
edge_uuid=d["edge_uuid"],
|
2023
2023
|
segments=[Segment2.__fromdict__(segment) for segment in d["segments"]],
|
2024
2024
|
)
|
2025
2025
|
|
@@ -2184,15 +2184,12 @@ class State(PClass):
|
|
2184
2184
|
rng = field(type=random.Random)
|
2185
2185
|
terminal = field(type=bool)
|
2186
2186
|
initial_to_play = field(type=list) # List[int]
|
2187
|
-
action_history = field(type=list) # List[Action]
|
2188
2187
|
route_cards = field(type=PVector) # List[int]
|
2189
2188
|
route_discards = field(type=PVector) # List[int]
|
2190
2189
|
player_hands = field(type=PVector) # List[PlayerInfo]
|
2191
2190
|
unit_cards = field(type=PVector) # List[int]
|
2192
2191
|
faceup_spots = field(type=PVector) # List[Union{Nothing, int}]
|
2193
2192
|
unit_discards = field(type=PVector) # List[int]
|
2194
|
-
most_clusters_player_idxs = field(type=list) # List[int]
|
2195
|
-
longest_trail_player_idxs = field(type=list) # List[int]
|
2196
2193
|
last_to_play = field(type=(int, type(None)), initial=None)
|
2197
2194
|
winners = field(type=list) # List[int]
|
2198
2195
|
# market_refills::Vector{MarketRefill}
|
@@ -2228,15 +2225,12 @@ class State(PClass):
|
|
2228
2225
|
"rng": rng2json(self.rng),
|
2229
2226
|
"terminal": self.terminal,
|
2230
2227
|
"initial_to_play": self.initial_to_play,
|
2231
|
-
"action_history": [x.__todict__() for x in self.action_history],
|
2232
2228
|
"route_cards": list(self.route_cards),
|
2233
2229
|
"route_discards": list(self.route_discards),
|
2234
2230
|
"player_hands": [x.__todict__() for x in self.player_hands],
|
2235
2231
|
"unit_cards": list(self.unit_cards),
|
2236
2232
|
"faceup_spots": list(self.faceup_spots),
|
2237
2233
|
"unit_discards": list(self.unit_discards),
|
2238
|
-
"most_clusters_player_idxs": self.most_clusters_player_idxs,
|
2239
|
-
"longest_trail_player_idxs": self.longest_trail_player_idxs,
|
2240
2234
|
"last_to_play": self.last_to_play,
|
2241
2235
|
"winners": self.winners,
|
2242
2236
|
}
|
@@ -2273,15 +2267,12 @@ class State(PClass):
|
|
2273
2267
|
rng=json2rng(d["rng"]),
|
2274
2268
|
terminal=d["terminal"],
|
2275
2269
|
initial_to_play=d["initial_to_play"],
|
2276
|
-
action_history=[AltAction.__fromdict__(a) for a in d["action_history"]],
|
2277
2270
|
route_cards=pvector(d["route_cards"]),
|
2278
2271
|
route_discards=pvector(d["route_discards"]),
|
2279
2272
|
player_hands=pvector([PlayerInfo.__fromdict__(h) for h in d["player_hands"]]),
|
2280
2273
|
unit_cards=pvector(d["unit_cards"]),
|
2281
2274
|
faceup_spots=pvector(d["faceup_spots"]),
|
2282
2275
|
unit_discards=pvector(d["unit_discards"]),
|
2283
|
-
most_clusters_player_idxs=d["most_clusters_player_idxs"],
|
2284
|
-
longest_trail_player_idxs=d["longest_trail_player_idxs"],
|
2285
2276
|
last_to_play=d.get("last_to_play"),
|
2286
2277
|
winners=d["winners"],
|
2287
2278
|
)
|
@@ -2544,9 +2535,7 @@ class PublicState(PClass):
|
|
2544
2535
|
decks = field(type=list) # List[PublicDeck]
|
2545
2536
|
piles = field(type=list) # List[Pile]
|
2546
2537
|
player_idxs = field(type=list) # List[int]
|
2547
|
-
game_idx = field(type=int)
|
2548
2538
|
initial_to_play = field(type=list) # List[int]
|
2549
|
-
action_history = field(type=list) # List[AltAction]
|
2550
2539
|
to_play = field(type=list) # List[int]
|
2551
2540
|
unit_discards = field(type=list) # List[int]
|
2552
2541
|
num_route_cards = field(type=int)
|
@@ -2554,11 +2543,9 @@ class PublicState(PClass):
|
|
2554
2543
|
num_unit_cards = field(type=int)
|
2555
2544
|
num_unit_discards = field(type=int)
|
2556
2545
|
faceup_spots = field(type=list) # List[Union{Nothing, int}]
|
2557
|
-
most_clusters_player_idxs = field(type=list)
|
2558
2546
|
players = field(type=list) # List[PublicPlayer]
|
2559
2547
|
player_hands = field(type=list) # List[PublicPlayerInfo]
|
2560
2548
|
last_to_play = field(type=(int, type(None)), initial=None)
|
2561
|
-
longest_trail_player_idxs = field(type=list)
|
2562
2549
|
winners = field(type=list)
|
2563
2550
|
terminal = field(type=bool)
|
2564
2551
|
captured_points = field(type=list) # List[CapturedPoint]
|
@@ -2583,9 +2570,7 @@ class PublicState(PClass):
|
|
2583
2570
|
"decks": [deck.__todict__() for deck in self.decks],
|
2584
2571
|
"piles": [pile.__todict__() for pile in self.piles],
|
2585
2572
|
"player_idxs": self.player_idxs,
|
2586
|
-
"game_idx": self.game_idx,
|
2587
2573
|
"initial_to_play": self.initial_to_play,
|
2588
|
-
"action_history": [x.__todict__() for x in self.action_history],
|
2589
2574
|
"to_play": self.to_play,
|
2590
2575
|
"unit_discards": self.unit_discards,
|
2591
2576
|
"num_route_cards": self.num_route_cards,
|
@@ -2593,11 +2578,9 @@ class PublicState(PClass):
|
|
2593
2578
|
"num_unit_cards": self.num_unit_cards,
|
2594
2579
|
"num_unit_discards": self.num_unit_discards,
|
2595
2580
|
"faceup_spots": self.faceup_spots,
|
2596
|
-
"most_clusters_player_idxs": self.most_clusters_player_idxs,
|
2597
2581
|
"players": [x.__todict__() for x in self.players],
|
2598
2582
|
"player_hands": [x.__todict__() for x in self.player_hands],
|
2599
2583
|
"last_to_play": self.last_to_play,
|
2600
|
-
"longest_trail_player_idxs": self.longest_trail_player_idxs,
|
2601
2584
|
"winners": self.winners,
|
2602
2585
|
"terminal": self.terminal,
|
2603
2586
|
"captured_points": [x.__todict__() for x in self.captured_points],
|
@@ -2624,9 +2607,7 @@ class PublicState(PClass):
|
|
2624
2607
|
decks=[PublicDeck.__fromdict__(deck) for deck in d["decks"]],
|
2625
2608
|
piles=[Pile.__fromdict__(x) for x in d["piles"]],
|
2626
2609
|
player_idxs=d["player_idxs"],
|
2627
|
-
game_idx=d["game_idx"],
|
2628
2610
|
initial_to_play=d["initial_to_play"],
|
2629
|
-
action_history=[AltAction.__fromdict__(x) for x in d["action_history"]],
|
2630
2611
|
to_play=d["to_play"],
|
2631
2612
|
unit_discards=d["unit_discards"],
|
2632
2613
|
num_route_cards=d["num_route_cards"],
|
@@ -2634,11 +2615,9 @@ class PublicState(PClass):
|
|
2634
2615
|
num_unit_cards=d["num_unit_cards"],
|
2635
2616
|
num_unit_discards=d["num_unit_discards"],
|
2636
2617
|
faceup_spots=d["faceup_spots"],
|
2637
|
-
most_clusters_player_idxs=d["most_clusters_player_idxs"],
|
2638
2618
|
players=[PublicPlayer.__fromdict__(x) for x in d["players"]],
|
2639
2619
|
player_hands=[PublicPlayerInfo.__fromdict__(x) for x in d["player_hands"]],
|
2640
2620
|
last_to_play=d.get("last_to_play"),
|
2641
|
-
longest_trail_player_idxs=d["longest_trail_player_idxs"],
|
2642
2621
|
winners=d["winners"],
|
2643
2622
|
terminal=d["terminal"],
|
2644
2623
|
captured_points=[CapturedPoint.__fromdict__(x) for x in d["captured_points"]],
|
@@ -2676,8 +2655,6 @@ def autoplay(seed, fig, num_players, policy, log=False):
|
|
2676
2655
|
if log:
|
2677
2656
|
printstate(s)
|
2678
2657
|
a = getnextaction(s, policy)
|
2679
|
-
if log:
|
2680
|
-
printaction(a, getstateidx(s))
|
2681
2658
|
s = getnextstate2(s, a)
|
2682
2659
|
actions.append(a)
|
2683
2660
|
|
@@ -2718,7 +2695,12 @@ def get_edges(rng, board_config, nodeuuid2idx):
|
|
2718
2695
|
segments = [
|
2719
2696
|
Segment2(uuid=s.uuid, unit_uuid=s.unit_uuid, pieces=[]) for s in matching_board_path.path.segments
|
2720
2697
|
]
|
2721
|
-
path = Path2(
|
2698
|
+
path = Path2(
|
2699
|
+
uuid=str(generate_uuid_with_rng(rng)),
|
2700
|
+
idx=path_idx,
|
2701
|
+
edge_uuid=link.uuid,
|
2702
|
+
segments=segments,
|
2703
|
+
)
|
2722
2704
|
paths.append(path)
|
2723
2705
|
|
2724
2706
|
if len(paths) == 0:
|
@@ -2954,15 +2936,12 @@ def getinitialstate(game_config):
|
|
2954
2936
|
game_config=game_config,
|
2955
2937
|
initial_to_play=initial_to_play,
|
2956
2938
|
rng=rng,
|
2957
|
-
action_history=[],
|
2958
2939
|
route_cards=pvector(route_cards),
|
2959
2940
|
route_discards=pvector([]),
|
2960
2941
|
player_hands=pvector(player_hands),
|
2961
2942
|
unit_cards=pvector(unit_cards),
|
2962
2943
|
unit_discards=pvector([]),
|
2963
2944
|
faceup_spots=pvector(faceup_spots),
|
2964
|
-
most_clusters_player_idxs=[],
|
2965
|
-
longest_trail_player_idxs=[],
|
2966
2945
|
last_to_play=None,
|
2967
2946
|
winners=[],
|
2968
2947
|
terminal=False,
|
@@ -3938,16 +3917,41 @@ def get_legal_actions_for_paths(game, player_idx):
|
|
3938
3917
|
return legal_actions
|
3939
3918
|
|
3940
3919
|
|
3920
|
+
def get_player_idxs_on_edge(game, edge):
|
3921
|
+
player_idxs = set()
|
3922
|
+
if not edge or not edge.paths:
|
3923
|
+
return list(player_idxs)
|
3924
|
+
|
3925
|
+
for path in edge.paths:
|
3926
|
+
for segment in path.segments:
|
3927
|
+
if segment.pieces and segment.pieces[0]:
|
3928
|
+
piece = game.pieceuuid2piece.get(segment.pieces[0])
|
3929
|
+
if piece:
|
3930
|
+
player_idxs.add(piece.player_idx)
|
3931
|
+
|
3932
|
+
return list(player_idxs)
|
3933
|
+
|
3934
|
+
|
3941
3935
|
def is_path_open_to_player(game, path_idx, player_idx):
|
3942
3936
|
|
3943
3937
|
if not game or path_idx < 0 or get_total_path_count(game) <= path_idx:
|
3944
3938
|
return False
|
3945
3939
|
|
3940
|
+
path = game.idx2path[path_idx]
|
3941
|
+
edge_idx = game.edgeuuid2idx[path.edge_uuid]
|
3942
|
+
edge = game.edges[edge_idx]
|
3943
|
+
|
3944
|
+
player_idxs_on_edge = get_player_idxs_on_edge(game, edge)
|
3945
|
+
|
3946
3946
|
# Check if edge is too crowded for the number of players
|
3947
|
-
|
3947
|
+
if game.game_config.num_players <= 3:
|
3948
|
+
if len(player_idxs_on_edge) > 0:
|
3949
|
+
return False
|
3950
|
+
|
3951
|
+
if player_idx in player_idxs_on_edge:
|
3952
|
+
return False
|
3948
3953
|
|
3949
3954
|
# Check if any segment of the path has pieces from any player
|
3950
|
-
path = game.idx2path[path_idx]
|
3951
3955
|
if path.segments[0].pieces:
|
3952
3956
|
return False
|
3953
3957
|
|
@@ -4438,9 +4442,7 @@ def getpublicstate(s):
|
|
4438
4442
|
decks=[getpublicdeck(s, deck) for deck in s.decks],
|
4439
4443
|
piles=s.piles,
|
4440
4444
|
player_idxs=s.player_idxs,
|
4441
|
-
game_idx=len(s.action_history),
|
4442
4445
|
initial_to_play=s.initial_to_play,
|
4443
|
-
action_history=s.action_history,
|
4444
4446
|
to_play=gettoplay(s),
|
4445
4447
|
unit_discards=list(s.unit_discards),
|
4446
4448
|
num_route_cards=len(s.route_cards),
|
@@ -4448,11 +4450,9 @@ def getpublicstate(s):
|
|
4448
4450
|
num_unit_cards=len(s.unit_cards),
|
4449
4451
|
num_unit_discards=len(s.unit_discards),
|
4450
4452
|
faceup_spots=list(s.faceup_spots),
|
4451
|
-
most_clusters_player_idxs=s.most_clusters_player_idxs,
|
4452
4453
|
players=[getpublicplayer(s, p) for p in s.players],
|
4453
4454
|
player_hands=[getpublicplayerinfo(s, p) for p in s.player_hands],
|
4454
4455
|
last_to_play=s.last_to_play,
|
4455
|
-
longest_trail_player_idxs=s.longest_trail_player_idxs,
|
4456
4456
|
winners=s.winners,
|
4457
4457
|
terminal=s.terminal,
|
4458
4458
|
captured_points=getcapturedpoints(s),
|
@@ -4582,14 +4582,6 @@ def getplayerpathidxs(s, player_idx):
|
|
4582
4582
|
return s.player_hands[player_idx].paths
|
4583
4583
|
|
4584
4584
|
|
4585
|
-
# Implementing the following Julia function:
|
4586
|
-
# getlastaction(s::State) = isempty(s.actions) ? nothing : s.actions[end]
|
4587
|
-
def getlastaction(s):
|
4588
|
-
if not s.action_history:
|
4589
|
-
return None
|
4590
|
-
return s.action_history[-1]
|
4591
|
-
|
4592
|
-
|
4593
4585
|
# Function implements the following Julia function:
|
4594
4586
|
# function getlastactionkey(s)
|
4595
4587
|
# last_action = getlastaction(s)
|
@@ -4600,10 +4592,7 @@ def getlastaction(s):
|
|
4600
4592
|
# end
|
4601
4593
|
@dispatch(State)
|
4602
4594
|
def getlastactiontype(s):
|
4603
|
-
|
4604
|
-
if last_action is None:
|
4605
|
-
return NoAction()
|
4606
|
-
return getactiontype(last_action.action_name)
|
4595
|
+
pass
|
4607
4596
|
|
4608
4597
|
|
4609
4598
|
def getactiontype(action_name):
|
@@ -4625,10 +4614,7 @@ def getactiontype(action_name):
|
|
4625
4614
|
# Function implements the following Julia function:
|
4626
4615
|
# getlastplayeridxplus1(s) = mod1(getlastaction(s).player_idx + 1, s.game_config.num_players)
|
4627
4616
|
def getlastplayeridxplus1(s):
|
4628
|
-
|
4629
|
-
if last_action is None:
|
4630
|
-
return 0
|
4631
|
-
return (last_action.player_idx + 1) % s.game_config.num_players
|
4617
|
+
pass
|
4632
4618
|
|
4633
4619
|
|
4634
4620
|
@dispatch(State)
|
@@ -4777,10 +4763,7 @@ def getlegalactionspecs(s, player_idx):
|
|
4777
4763
|
# Val(player_idx == last_action.player_idx)
|
4778
4764
|
# end
|
4779
4765
|
def getrepeatplayerbooltype(s, player_idx):
|
4780
|
-
|
4781
|
-
if last_action is None:
|
4782
|
-
return getbooltype(False)
|
4783
|
-
return getbooltype(player_idx == last_action.player_idx)
|
4766
|
+
pass
|
4784
4767
|
|
4785
4768
|
|
4786
4769
|
def combinations(a, n=None):
|
@@ -4891,22 +4874,8 @@ def getrouteoptionsets(s, player_idx, min_required):
|
|
4891
4874
|
# end
|
4892
4875
|
@dispatch(State, int, object, object)
|
4893
4876
|
def getlegalactionspecsforplayer(s, player_idx, repeat_player, last_action):
|
4894
|
-
min_initial_routes = getsettingvalue(s, 'min_initial_routes')
|
4895
4877
|
min_chosen_routes = getsettingvalue(s, 'min_chosen_routes')
|
4896
4878
|
|
4897
|
-
# Initial Route Card Discard
|
4898
|
-
if getsettingvalue(s, 'action_route_discard') and len(s.action_history) < s.game_config.num_players:
|
4899
|
-
return [
|
4900
|
-
ActionSpec(
|
4901
|
-
player_idx=player_idx,
|
4902
|
-
action_name="ROUTE_DISCARD",
|
4903
|
-
return_route_option_sets = getrouteoptionsets(s, player_idx, min_initial_routes),
|
4904
|
-
draw_faceup_spots={},
|
4905
|
-
points = [],
|
4906
|
-
paths = [],
|
4907
|
-
)
|
4908
|
-
]
|
4909
|
-
|
4910
4879
|
action_specs = []
|
4911
4880
|
if getsettingvalue(s, 'action_draw_unit_faceup') and s.faceup_spots:
|
4912
4881
|
|
@@ -5764,11 +5733,6 @@ def getunavailablepoints(s):
|
|
5764
5733
|
return unavailable_points
|
5765
5734
|
|
5766
5735
|
|
5767
|
-
def getstateidx(s):
|
5768
|
-
return len(s.action_history)
|
5769
|
-
|
5770
|
-
|
5771
|
-
|
5772
5736
|
# Implementing the following Julia function:
|
5773
5737
|
# function calcfinalscores(s::State)
|
5774
5738
|
# if !s.terminal
|
@@ -5833,9 +5797,7 @@ def printplayer(s, player_idx):
|
|
5833
5797
|
|
5834
5798
|
|
5835
5799
|
def printstate(s):
|
5836
|
-
state_idx = getstateidx(s)
|
5837
5800
|
print(f"*************** State {state_idx} ***************")
|
5838
|
-
print(f"Most clusters: {list(s.most_clusters_player_idxs)}")
|
5839
5801
|
print(f"Last to play: {s.last_to_play}")
|
5840
5802
|
print(f"Winners: {list(s.winners)}")
|
5841
5803
|
print(f"Route Deck: {list(s.route_cards)}")
|
@@ -5961,24 +5923,6 @@ def getprivatescore(s, hand):
|
|
5961
5923
|
amount=path_scores[len],
|
5962
5924
|
))
|
5963
5925
|
|
5964
|
-
# Bonus: most clusters
|
5965
|
-
if getsettingvalue(s, 'most_clusters_bonus'):
|
5966
|
-
bonus_most_clusters_score = getsettingvalue(s.game_config.fig, 'bonus_most_clusters_score')
|
5967
|
-
if player_idx in s.most_clusters_player_idxs:
|
5968
|
-
breakdown.append(ScoreItem(
|
5969
|
-
code_idx=getscorecodeidx(s.game_config.fig, 'MOST_CLUSTERS'),
|
5970
|
-
amount=bonus_most_clusters_score,
|
5971
|
-
))
|
5972
|
-
|
5973
|
-
# Longest trail
|
5974
|
-
if not getsettingvalue(s, 'disable_longest_path_bonus'):
|
5975
|
-
longest_path_score = getsettingvalue(s.game_config.fig, 'longest_path_score')
|
5976
|
-
if player_idx in s.longest_trail_player_idxs:
|
5977
|
-
breakdown.append(ScoreItem(
|
5978
|
-
code_idx=getscorecodeidx(s.game_config.fig, 'LONGEST_ROAD'),
|
5979
|
-
amount=longest_path_score,
|
5980
|
-
))
|
5981
|
-
|
5982
5926
|
# Completed routes
|
5983
5927
|
if False and getsettingvalue(s, 'route_scoring'):
|
5984
5928
|
routes = s.game_config.fig.board_config.routes
|
@@ -6479,10 +6423,6 @@ def get_imagined_state(static_board_config, player_state):
|
|
6479
6423
|
for unit_card in my_hand.unit_cards:
|
6480
6424
|
remove_card_idx(possible_unit_card_idxs, unit_card-1)
|
6481
6425
|
|
6482
|
-
for action in public_state.action_history:
|
6483
|
-
if action.action_name == "DRAW_UNIT_DECK":
|
6484
|
-
remove_card_idx(possible_unit_card_idxs, action.unit_card_num - 1)
|
6485
|
-
|
6486
6426
|
imagined_unit_card_idxs = rng.sample(possible_unit_card_idxs, public_state.num_unit_cards)
|
6487
6427
|
imagined_unit_cards = [x+1 for x in imagined_unit_card_idxs]
|
6488
6428
|
remove_card_idxs(possible_unit_card_idxs, imagined_unit_card_idxs)
|
@@ -6552,15 +6492,12 @@ def get_imagined_state(static_board_config, player_state):
|
|
6552
6492
|
rng = rng, # TODO: again figure out this stochasticity
|
6553
6493
|
terminal = public_state.terminal,
|
6554
6494
|
initial_to_play = public_state.initial_to_play,
|
6555
|
-
action_history = public_state.action_history,
|
6556
6495
|
route_cards = pvector(imagined_route_cards), # Guess at this.
|
6557
6496
|
route_discards = pvector(imagined_route_discards), # Guess at this.
|
6558
6497
|
player_hands = pvector(imagined_player_hands), # Guess at this.
|
6559
6498
|
unit_cards = pvector(imagined_unit_cards), # Guess at this.
|
6560
6499
|
faceup_spots = pvector(public_state.faceup_spots),
|
6561
6500
|
unit_discards = pvector(public_state.unit_discards),
|
6562
|
-
most_clusters_player_idxs = public_state.most_clusters_player_idxs,
|
6563
|
-
longest_trail_player_idxs = public_state.longest_trail_player_idxs,
|
6564
6501
|
last_to_play = public_state.last_to_play,
|
6565
6502
|
winners = public_state.winners,
|
6566
6503
|
)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
graph_games_proto/__init__.py,sha256=O5XjRfe3DlxbJn4zezDvvy7cXvL4IzIRPZCL3Y-n7s8,776
|
2
|
+
graph_games_proto/all_types.py,sha256=IpbwftEcHS5Ewz-saFNk0lO9FvcbuHG36odRTayCXUk,54911
|
3
|
+
graph_games_proto/fns.py,sha256=tXNB_opKY3SYSh0NHlIH77l_xKaTVaVzIDSQrP6G_hg,236864
|
4
|
+
graph_games_proto/main.py,sha256=fj2U7KcwrpZtuUhjOX5yVxY18LZvvsxDFYZ_S5mxe04,145
|
5
|
+
graph_games_proto/state.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
graph_games_proto-0.3.1755.dist-info/METADATA,sha256=GbwVTuU6vysYcnS_l9_wdaFLS3M0XcfYSx-A97huRiA,188
|
7
|
+
graph_games_proto-0.3.1755.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
+
graph_games_proto-0.3.1755.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
|
9
|
+
graph_games_proto-0.3.1755.dist-info/RECORD,,
|
@@ -1,9 +0,0 @@
|
|
1
|
-
graph_games_proto/__init__.py,sha256=WhMxLCEu4pgZ9LRltIgPLcYT7hTY6pMayISVcT2HN74,789
|
2
|
-
graph_games_proto/all_types.py,sha256=IpbwftEcHS5Ewz-saFNk0lO9FvcbuHG36odRTayCXUk,54911
|
3
|
-
graph_games_proto/fns.py,sha256=rgPfMVmsCppJP0me5CFWpbBHi9fG0XGC7fZFZfnAaxA,240267
|
4
|
-
graph_games_proto/main.py,sha256=fj2U7KcwrpZtuUhjOX5yVxY18LZvvsxDFYZ_S5mxe04,145
|
5
|
-
graph_games_proto/state.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
graph_games_proto-0.3.1748.dist-info/METADATA,sha256=OjdLHbApfzG4ZHPWvyrhpJGHnwzR1h8AgH58PCXNSd0,188
|
7
|
-
graph_games_proto-0.3.1748.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
-
graph_games_proto-0.3.1748.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
|
9
|
-
graph_games_proto-0.3.1748.dist-info/RECORD,,
|
File without changes
|
File without changes
|