コード例 #1
0
ファイル: Transduction.cs プロジェクト: caomw/prepose
 public static List<Transduction> Complement(Transduction m)
 {
     List<Transduction> moves = Enum.GetValues(typeof(Transduction)).Cast<Transduction>().ToList();
     moves.Remove(m);
     moves.Remove(Transduction.Stay);
     return moves;
 }
コード例 #2
0
        public static List <Transduction> Complement(Transduction m)
        {
            List <Transduction> moves = Enum.GetValues(typeof(Transduction)).Cast <Transduction>().ToList();

            moves.Remove(m);
            moves.Remove(Transduction.Stay);
            return(moves);
        }
コード例 #3
0
        public void MakeOneStep(Transduction move)
        {
            char c = TransductionUtil.ToChar(move);
            IEnumerable <Move <BvSet> > movesFromCurrent = moveAutomaton.GetMovesFrom(currentState);

            foreach (Move <BvSet> m in movesFromCurrent)
            {
                if (!solver.MkAnd(m.Condition, solver.MkCharConstraint(true, c)).IsEmpty)
                {
                    currentState = m.TargetState;
                    return;
                }
            }

            throw new Exception("Move not available");
        }
コード例 #4
0
ファイル: MoveSequence.cs プロジェクト: mhusinsky/prepose
        public void MakeOneStep(Transduction move)
        {
            char c = TransductionUtil.ToChar(move);
            IEnumerable<Move<BvSet>> movesFromCurrent = moveAutomaton.GetMovesFrom(currentState);

            foreach (Move<BvSet> m in movesFromCurrent)
            {
                if (!solver.MkAnd(m.Condition, solver.MkCharConstraint(true, c)).IsEmpty)
                {
                    currentState = m.TargetState;
                    return;
                }
            }

            throw new Exception("Move not available");
        }
コード例 #5
0
        public static char ToChar(Transduction m)
        {
            List <Transduction> moves = Enum.GetValues(typeof(Transduction)).Cast <Transduction>().ToList();

            return((char)(moves.IndexOf(m) + 96));
        }
コード例 #6
0
 public static Pen ToColor(Transduction m)
 {
     return(pen);
 }
コード例 #7
0
        public TreeBodyPart MakeMove(Transduction move)
        {
            IEnumerable <TreeBodyPart> res;

            switch (move)
            {
            case Transduction.ToLeft: { res = toleft(); break; }

            case Transduction.ToRight: { res = toright(); break; }

            case Transduction.ToUp: { res = toup(); break; }

            case Transduction.ToDown: { res = todown(); break; }

            case Transduction.ToFront: { res = tofront(); break; }

            case Transduction.RotFroClock: { res = rotFroClock(); break; }

            case Transduction.RotFroCClock: { res = rotFroCClock(); break; }

            case Transduction.RotSagClock: { res = rotSagClock(); break; }

            case Transduction.RotSagCClock: { res = rotSagCClock(); break; }

            case Transduction.RotHorClock: { res = rotHorClock(); break; }

            case Transduction.RotHorCClock: { res = rotHorCClock(); break; }

            case Transduction.LeftST: { res = leftst(); break; }

            case Transduction.RightST: { res = rightst(); break; }

            case Transduction.ResetJT: { res = resetjt(); break; }

            case Transduction.ResetST: { res = resetst(); break; }

            case Transduction.ResetAT: { res = resetat(); break; }

            case Transduction.SpineShoulder: { res = spineshoulder(); break; }

            case Transduction.SpineBase: { res = spinebase(); break; }

            case Transduction.Hand: { res = hand(); break; }

            case Transduction.Neck: { res = neck(); break; }

            case Transduction.Shoulder: { res = shoulder(); break; }

            case Transduction.Elbow: { res = elbow(); break; }

            case Transduction.Wrist: { res = wrist(); break; }

            case Transduction.Hip: { res = hip(); break; }

            case Transduction.Knee: { res = knee(); break; }

            case Transduction.Head: { res = head(); break; }

            case Transduction.HandTip: { res = handtip(); break; }

            case Transduction.Thumb: { res = thumb(); break; }

            case Transduction.Foot: { res = foot(); break; }

            default: throw new Exception("This move doesn't exist");
            }
            foreach (var b in res)
            {
                return(b);
            }
            return(null);
        }
コード例 #8
0
ファイル: Transduction.cs プロジェクト: caomw/prepose
 public static Pen ToColor(Transduction m)
 {
     return pen;
 }
コード例 #9
0
ファイル: Transduction.cs プロジェクト: caomw/prepose
 public static char ToChar(Transduction m)
 {
     List<Transduction> moves = Enum.GetValues(typeof(Transduction)).Cast<Transduction>().ToList();
     return (char)(moves.IndexOf(m)+96);
 }
コード例 #10
0
ファイル: TreeBodyPart.cs プロジェクト: mhusinsky/prepose
        public TreeBodyPart MakeMove(Transduction move)
        {
            IEnumerable<TreeBodyPart> res;
            switch (move)
            {

                case Transduction.ToLeft: { res = toleft(); break; }
                case Transduction.ToRight: { res = toright(); break; }
                case Transduction.ToUp: { res = toup(); break; }
                case Transduction.ToDown: { res = todown(); break; }
                case Transduction.ToFront: { res = tofront(); break; }
                case Transduction.RotFroClock: { res = rotFroClock(); break; }
                case Transduction.RotFroCClock: { res = rotFroCClock(); break; }
                case Transduction.RotSagClock: { res = rotSagClock(); break; }
                case Transduction.RotSagCClock: { res = rotSagCClock(); break; }
                case Transduction.RotHorClock: { res = rotHorClock(); break; }
                case Transduction.RotHorCClock: { res = rotHorCClock(); break; }
                case Transduction.LeftST: { res = leftst(); break; }
                case Transduction.RightST: { res = rightst(); break; }
                case Transduction.ResetJT: { res = resetjt(); break; }
                case Transduction.ResetST: { res = resetst(); break; }
                case Transduction.ResetAT: { res = resetat(); break; }
                case Transduction.SpineShoulder: { res = spineshoulder(); break; }
                case Transduction.SpineBase: { res = spinebase(); break; }
                case Transduction.Hand: { res = hand(); break; }
                case Transduction.Neck: { res = neck(); break; }
                case Transduction.Shoulder: { res = shoulder(); break; }
                case Transduction.Elbow: { res = elbow(); break; }
                case Transduction.Wrist: { res = wrist(); break; }
                case Transduction.Hip: { res = hip(); break; }
                case Transduction.Knee: { res = knee(); break; }
                case Transduction.Head: { res = head(); break; }
                case Transduction.HandTip: { res = handtip(); break; }
                case Transduction.Thumb: { res = thumb(); break; }
                case Transduction.Foot: { res = foot(); break; }
                default: throw new Exception("This move doesn't exist");
            }
            foreach (var b in res) return b;
            return null;
        }