def setup_mock_unityenvironment(mock_env, mock_spec, mock_decision, mock_termination):
    """
    Takes a mock UnityEnvironment and adds the appropriate properties, defined by the mock
    GroupSpec and BatchedStepResult.

    :Mock mock_env: A mock UnityEnvironment, usually empty.
    :Mock mock_spec: An AgentGroupSpec object that specifies the params of this environment.
    :Mock mock_decision: A DecisionSteps object that will be returned at each step and reset.
    :Mock mock_termination: A TerminationSteps object that will be returned at each step and reset.
    """
    mock_env.behavior_specs = BehaviorMapping({"MockBrain": mock_spec})
    mock_env.get_steps.return_value = (mock_decision, mock_termination)
Exemplo n.º 2
0
 def behavior_specs(self) -> MappingType[str, BehaviorSpec]:
     return BehaviorMapping(self._env_specs)
Exemplo n.º 3
0
 def behavior_specs(self):
     behavior_dict = {}
     for n in self.names:
         behavior_dict[n] = self.behavior_spec
     return BehaviorMapping(behavior_dict)