|
|
|
|
|
|
public void AgentDied() |
|
|
|
{ |
|
|
|
bool smallAlive = false; |
|
|
|
int numLiveAgents = 0; |
|
|
|
numLiveAgents++; |
|
|
|
} |
|
|
|
} |
|
|
|
bool largeAlive = false; |
|
|
|
|
|
|
Debug.Log("Big Agent Wins"); |
|
|
|
foreach (var smallAgent in smallAgents) |
|
|
|
{ |
|
|
|
smallAgent.SetReward(-1.0f); |
|
|
|
if (smallAgent.gameObject.activeInHierarchy) |
|
|
|
{ |
|
|
|
smallAgent.SetReward(-1.0f / numLiveAgents); |
|
|
|
} |
|
|
|
} |
|
|
|
foreach (var largeAgent in largeAgents) |
|
|
|
{ |
|
|
|
|
|
|
Debug.Log("Small Agents Win"); |
|
|
|
foreach (var smallAgent in smallAgents) |
|
|
|
{ |
|
|
|
smallAgent.SetReward(1.0f); |
|
|
|
smallAgent.SetReward(1.0f / numLiveAgents); |
|
|
|
} |
|
|
|
foreach (var largeAgent in largeAgents) |
|
|
|
{ |
|
|
|