|
|
|
|
|
|
/// Uses the Decision Component to decide that action to take
|
|
|
|
public void DecideAction(Dictionary<Agent, AgentInfo> agentInfo) |
|
|
|
{ |
|
|
|
if (coord!=null) |
|
|
|
{ |
|
|
|
if (coord!=null) |
|
|
|
{ |
|
|
|
} |
|
|
|
if (decision == null) |
|
|
|
} |
|
|
|
|
|
|
|
if (decision == null) |
|
|
|
|
|
|
|
agent.UpdateVectorAction(decision.Decide( |
|
|
|
agent.UpdateVectorAction(decision.Decide( |
|
|
|
agentInfo[agent].stackedVectorObservation, |
|
|
|
agentInfo[agent].visualObservations, |
|
|
|
agentInfo[agent].reward, |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
agentInfo[agent].stackedVectorObservation, |
|
|
|
agentInfo[agent].visualObservations, |
|
|
|
agentInfo[agent].reward, |
|
|
|
agentInfo[agent].done, |
|
|
|
agentInfo[agent].memories)); |
|
|
|
agentInfo[agent].stackedVectorObservation, |
|
|
|
agentInfo[agent].visualObservations, |
|
|
|
agentInfo[agent].reward, |
|
|
|
agentInfo[agent].done, |
|
|
|
agentInfo[agent].memories)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); |
|
|
|
broadcast = EditorGUILayout.Toggle(new GUIContent("Broadcast", |
|
|
|
"If checked, the brain will broadcast states and actions to Python."), broadcast); |
|
|
|
if (brain.gameObject.GetComponent<Decision>() == null) |
|
|
|
{ |
|
|
|
#if UNITY_EDITOR
|
|
|
|
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); |
|
|
|
broadcast = EditorGUILayout.Toggle(new GUIContent("Broadcast", |
|
|
|
"If checked, the brain will broadcast states and actions to Python."), broadcast); |
|
|
|
if (brain.gameObject.GetComponent<Decision>() == null) |
|
|
|
{ |
|
|
|
} |
|
|
|
#endif
|
|
|
|
} |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
} |