Skip to content

Commit

Permalink
change assimilator reward
Browse files Browse the repository at this point in the history
  • Loading branch information
biug committed Nov 23, 2018
1 parent f265b01 commit ee5079f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/protoss_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 75,8 @@ def _building_reward(self, timestep, action):
gateway_num = unit_counts.get(units.Protoss.Gateway, 0)
gateway_in_queue = building_queue[Gateway.id]
gateway_num = gateway_in_queue
nexus_num = unit_counts.get(units.Protoss.Nexus, 0)
assimilator_num = unit_counts.get(units.Protoss.Assimilator, 0)

if building.unit_type == units.Protoss.Pylon:
pylon_num = unit_counts.get(units.Protoss.Pylon, 0)
Expand Down Expand Up @@ -106,7 108,11 @@ def _building_reward(self, timestep, action):
return 2 ** (3 - gateway_num)
return -2
elif building.unit_type == units.Protoss.Assimilator:
return 4
if assimilator_num > 2 * nexus_num or nexus_num == 0:
return -8
elif gateway_num == 0:
return -8
return (2 * nexus_num - assimilator_num 1) / nexus_num
elif building.unit_type == units.Protoss.CyberneticsCore:
cybernetics_num = unit_counts.get(units.Protoss.CyberneticsCore, 0)
cybernetics_in_queue = building_queue[CyberneticsCore.id]
Expand Down

0 comments on commit ee5079f

Please sign in to comment.