Esempio n. 1
0
        public Goal Copy( Goal other )
        {
            Goal copy;
            if( !m_GoalMap.TryGetValue( other, out copy ) )
            {
                copy	= other.Copy( this );

                m_GoalMap[ other ]	= copy;
            }

            return copy;
        }
Esempio n. 2
0
 public bool Solve( Goal goal )
 {
     return m_GoalStack.Solve( goal );
 }
Esempio n. 3
0
 public GoalAnd( Goal g0, Goal g1, Goal g2 )
     : this(g0.Solver, new Goal[] { g0, g1, g2 })
 {
 }
Esempio n. 4
0
 public GoalAnd( Goal g0, Goal g1 )
     : this(g0.Solver, new Goal[] { g0, g1 })
 {
 }
Esempio n. 5
0
 public GoalAnd( Goal g0 )
     : this(g0.Solver, new Goal[] { g0 })
 {
 }
Esempio n. 6
0
 public GoalAnd( Solver solver, Goal[] goalList )
     : base(solver)
 {
     m_GoalList		= goalList;
     m_Index			= new RevValue<int>( solver.StateStack, 0 );
 }
Esempio n. 7
0
        public Goal[] Copy( Goal[] other )
        {
            Goal[] copy	= new Goal[ other.Length ];
            for( int idx = 0; idx < other.Length; ++idx )
            {
                copy[ idx ]		= Copy( other[ idx ] );
            }

            return copy;
        }
Esempio n. 8
0
File: Goal.cs Progetto: nofear/Mara
 public Goal Or( Goal g0 )
 {
     return new GoalOr( this, g0 );
 }
Esempio n. 9
0
 public GoalOr( Solver solver, Goal[] goalList )
     : base(solver)
 {
     m_GoalList		= goalList;
     m_Index			= 0;
 }
Esempio n. 10
0
File: Goal.cs Progetto: nofear/Mara
 public void Add( Goal goal )
 {
     m_Solver.GoalStack.Add( goal );
 }
Esempio n. 11
0
File: Goal.cs Progetto: nofear/Mara
 public Goal And( Goal g0 )
 {
     return new GoalAnd( this, g0 );
 }
Esempio n. 12
0
 public GoalAnd(Goal g0, Goal g1, Goal g2) :
     this(g0.Solver, new Goal[] { g0, g1, g2 })
 {
 }
Esempio n. 13
0
 public GoalAnd(Goal g0, Goal g1) :
     this(g0.Solver, new Goal[] { g0, g1 })
 {
 }
Esempio n. 14
0
 public GoalAnd(Goal g0) :
     this(g0.Solver, new Goal[] { g0 })
 {
 }
Esempio n. 15
0
        public bool Solve( Goal goal )
        {
            Add( goal );
            Execute();

            m_IntObjective.Init();

            return !m_IsFailed;
        }
Esempio n. 16
0
        public void Add( Goal goal )
        {
            m_StackAnd.Push( goal );
            m_StackAndMax	= Math.Max( m_StackAndMax, m_StackAnd.Count );

            GoalOr goalOr	= goal as GoalOr;

            if( !ReferenceEquals( goalOr, null ) )
            {
                m_StackOr.Push( goalOr );
                m_StackOrCount++;
                m_StackOrMax	= Math.Max( m_StackOrMax, m_StackOr.Count );
            }
        }