Exemplo n.º 1
0
 internal void GetAction(RLElementBase sender, double[][] state, double reward, Dictionary <string, string> info = null)
 {
     this.sender = sender;
     this.state  = state;
     this.reward = reward;
     this.info   = info;
 }
Exemplo n.º 2
0
        public Response Act(int action)
        {
            if (sender != null)
            {
                if (sender.TryAct(action))
                {
                    sender.Act(action);
                    sender = null;
                }
            }
            else
            {
                throw new InvalidOperationException("No sender waiting for action");
            }

            Simulation.Train();

            if (Simulation.MyExecutive.IsEnded)
            {
                Simulation.EndTrain();
            }

            return(GetResponse());
        }