|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ExternalCommunicator coord; |
|
|
|
|
|
|
|
/// Modify only in inspector : Reference to the Graph asset
|
|
|
|
public TextAsset graphModel; |
|
|
|
/// Modify only in inspector : If a scope was used when training the model, specify it here
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
#endif
|
|
|
|
if (brain.gameObject.transform.parent.gameObject.GetComponent<Academy>().communicator == null) |
|
|
|
{ |
|
|
|
coord = null; |
|
|
|
} |
|
|
|
else if (brain.gameObject.transform.parent.gameObject.GetComponent<Academy>().communicator is ExternalCommunicator) |
|
|
|
{ |
|
|
|
coord = (ExternalCommunicator)brain.gameObject.transform.parent.gameObject.GetComponent<Academy>().communicator; |
|
|
|
coord.SubscribeBrain(brain); |
|
|
|
} |
|
|
|
|
|
|
|
if (graphModel != null) |
|
|
|
{ |
|
|
|
|
|
|
currentBatchSize = brain.agents.Count; |
|
|
|
if (currentBatchSize == 0) |
|
|
|
{ |
|
|
|
|
|
|
|
if (coord!=null) |
|
|
|
{ |
|
|
|
coord.giveBrainInfo(brain); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
i++; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
if (coord!=null) |
|
|
|
{ |
|
|
|
coord.giveBrainInfo(brain); |
|
|
|
} |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|