示例#1
0
        public State<double> updateBelief(CS8803AGA.PsychSim.State.Action a, double evidance)
        {
            setBelief();

            State<Double> temp = new State<Double>(3, 3, 0);

            foreach (var s in mdp.GetStates())
            {
                foreach (var sDelta in mdp.GetStates())
                {
                    var t = temp.getCellAt(sDelta.getX(), sDelta.getY());
                    Double x = t.getContent();
                    x += mdp.transitionProbability(sDelta, s, a) * (belief.getCellAt(sDelta.getX(), sDelta.getY()).getContent());
                    t.setContent(x);
                }
            }

            double alpha = 1.56;

            foreach (var s in mdp.GetStates())
            {
                var b = belief.getCellAt(s.getX(), s.getY());
                Double x = alpha * (sensor.senses(evidance, s)) * (temp.getCellAt(s.getX(), s.getY()).getContent());
                b.setContent(x);
            }

            return belief;
        }
示例#2
0
        public override void act(CS8803AGA.collision.Collider mover, bool shouting)
        {
            setFlags();
            GameplayManager.say(getDialogue(shouting));

            if (hasForm && !hasSignature)
            {
                GameplayManager.Game.Keys[GameState.GameFlag.REGISTRAR_SIGNED_FORM] = true;
            }
        }
        private List<Cell<Double>> possibleOutcomes(Cell<Double> c, CS8803AGA.PsychSim.State.Action a)
        {
            List<Cell<Double>> outcomes = new List<Cell<Double>>();

            outcomes.Add(state.result(c, a));
            outcomes.Add(state.result(c, a.getFirstRightAngledAction()));
            outcomes.Add(state.result(c, a.getSecondRightAngledAction()));

            return outcomes;
        }
        public double probability(Cell<Double> sDelta, Cell<Double> s, CS8803AGA.PsychSim.State.Action a)
        {
            double prob = 0;

            List<Cell<Double>> outcomes = possibleOutcomes(s, a);
            for (int i = 0; i < outcomes.Count; i++)
            {
                if (sDelta.Equals(outcomes[i]))
                {
                    prob += distribution[i];
                }
            }

            return prob;
        }
示例#5
0
 public Cell<Double> getNextState(CS8803AGA.PsychSim.State.Action a, Cell<Double> c)
 {
     int x = a.getXResult(c.getX());
     int y = a.getYResult(c.getY());
     return this.mdp.S.cellLookup[x][y];
 }
 public override void handleImpact(CS8803AGA.collision.Collider mover)
 {
     // don't actually care about things moving through it, just what it's touching while it's alive
 }
示例#7
0
 public double transitionProbability(Cell<Double> sDelta, Cell<Double> s, CS8803AGA.PsychSim.State.Action a)
 {
     return transitionProbabilityFunction.probability(sDelta, s, a);
 }