Пример #1
0
        // агент вибирає, яку дію виконати
        private void TakeAgentAction()
        {
            var         locationService = locationBuilder.getLocationService(currentAgent.AgentLocation, currentAgent.Direction);
            var         inputs          = sensorService.GetInputsForNetwork(allAgents, currentAgent, locationService);
            AgentAction action          = currentAgent.GetNetwork().ChooseAction(inputs);

            switch (action)
            {
            case AgentAction.Move:
            {
                MoveAgent();
                break;
            }

            case AgentAction.Eat:
            {
                EatAgent();

                break;
            }

            case AgentAction.TurnRight:
            {
                TurnAgentRight();
                break;
            }

            case AgentAction.TurnLeft:
            {
                TurnAgentLeft();
                break;
            }

            default:
                break;
            }
        }