当前位置: 首页>>代码示例>>C#>>正文


C# State.getCellAt方法代码示例

本文整理汇总了C#中State.getCellAt方法的典型用法代码示例。如果您正苦于以下问题:C# State.getCellAt方法的具体用法?C# State.getCellAt怎么用?C# State.getCellAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在State的用法示例。


在下文中一共展示了State.getCellAt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: updateBelief

        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;
        }
开发者ID:gripp,项目名称:psychic-octo-nemesis,代码行数:28,代码来源:POMDP.cs

示例2: createMDP

 public static MDP createMDP(State<Double> state)
 {
     return new MDP(state.getCells(),
             state.getCellAt(1, 1), new ActionsFunction(state),
             new TransitionProbabilityFunction(state),
              new RewardFunction());
 }
开发者ID:gripp,项目名称:psychic-octo-nemesis,代码行数:7,代码来源:MDPFactory.cs

示例3: values

        public static void values()
        {
            State<Double> S = new State<Double>(3, 3, -1.0);
            double r = -100;
            double epsilon = 0.00001;
            S.getCellAt(1, 3).setContent(r);
            S.getCellAt(3, 3).setContent(10.0);

            MDP mdp = new MDP(S.getCells(), S.getCellAt(1, 3), new ActionsFunction(S),
                    new TransitionProbabilityFunction(S),
                    new RewardFunction());

            ValueIteration vi = new ValueIteration(0.99);
            Dictionary<Cell<Double>, Double> map = vi.valueIteration(mdp, epsilon);
            foreach (var c in map)
            {
                Console.Write(c.Key.getX() + " " + c.Key.getY() + ": ");
                Console.WriteLine(c.Value);
                Console.WriteLine();
            }
        }
开发者ID:gripp,项目名称:psychic-octo-nemesis,代码行数:21,代码来源:MDPValueIteration.cs

示例4: MDPPolicyIteration

        public MDPPolicyIteration()
        {
            S = new State<Double>(3, 3, 0);
            Double[] val = { 1, 0, -1, 2, -1, -2, 3, -2, -3 };

            S.setContent(val);

            mdp = new MDP(S.getCells(), S.getCellAt(1, 1), new ActionsFunction(S),
                   new TransitionProbabilityFunction(S),
                   new RewardFunction());

            double epsilon = 0.00001;

            PolicyEvaluation pev = new PolicyEvaluation(1000, epsilon);

            pi = new PolicyIteration(pev);

            policy = pi.policyIteration(mdp);
        }
开发者ID:gripp,项目名称:psychic-octo-nemesis,代码行数:19,代码来源:MDPPolicyIteration.cs

示例5: values

        public static void values()
        {
            LookupPolicy policy = null;
            State<Double> S = new State<Double>(3, 3, 0);

            MDP mdp1 = new MDP(S.getCells(), S.getCellAt(1, 1), new ActionsFunction(S),
                               new TransitionProbabilityFunction(S),
                               new RewardFunction());

            State<Double> S1 = new State<Double>(3, 3, 0);
            S1.getCellAt(1, 1).setContent(-1);
            S1.getCellAt(1, 2).setContent(0);
            S1.getCellAt(1, 3).setContent(-1);

            S1.getCellAt(2, 1).setContent(-2);
            S1.getCellAt(2, 2).setContent(1);
            S1.getCellAt(2, 3).setContent(-2);

            S1.getCellAt(3, 1).setContent(-3);
            S1.getCellAt(3, 2).setContent(2);
            S1.getCellAt(3, 3).setContent(-3);

            MDP mdp2 = new MDP(S1.getCells(), S1.getCellAt(1, 1), new ActionsFunction(S1),
                                    new TransitionProbabilityFunction(S1),
                                    new RewardFunction());
            State<Double> S2 = new State<Double>(3, 3, 0);

            // double r = -100;
            double epsilon = 0.00001;
            S2.getCellAt(1, 1).setContent(1);
            S2.getCellAt(1, 2).setContent(0);
            S2.getCellAt(1, 3).setContent(-1);

            S2.getCellAt(2, 1).setContent(2);
            S2.getCellAt(2, 2).setContent(-1);
            S2.getCellAt(2, 3).setContent(-2);

            S2.getCellAt(3, 1).setContent(3);
            S2.getCellAt(3, 2).setContent(-2);
            S2.getCellAt(3, 3).setContent(-3);

            MDP mdp = new MDP(S2.getCells(), S2.getCellAt(1, 1), new ActionsFunction(S2),
                   new TransitionProbabilityFunction(S2),
                   new RewardFunction());

            PolicyEvaluationRecursive pev = new PolicyEvaluationRecursive(1000, epsilon);

            PolicyIterationRecursive pi = new PolicyIterationRecursive(pev);

            policy = pi.policyIteration(mdp, mdp1, mdp2);

            foreach (var s in S.getCells())
            {

                try
                {
                    CS8803AGA.PsychSim.State.Action a = policy.action(s);

                    Console.Write(s.getX() + " " + s.getY() + ": ");
                    Console.WriteLine(a.i);
                    Console.WriteLine();
                }
                catch (Exception e)
                {
                }
            }
        }
开发者ID:gripp,项目名称:psychic-octo-nemesis,代码行数:67,代码来源:MDPPolicyIterationRecursive.cs

示例6: ActionsFunction

 public ActionsFunction(State<Double> state)
 {
     Cell<Double> c = state.getCellAt(3, 3);
     terminals.Add(c);
 }
开发者ID:gripp,项目名称:psychic-octo-nemesis,代码行数:5,代码来源:ActionsFunction.cs


注:本文中的State.getCellAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。