Beispiel #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;
        }
Beispiel #2
0
 public bool Solve( Goal goal )
 {
     return m_GoalStack.Solve( goal );
 }
Beispiel #3
0
 public GoalAnd( Goal g0, Goal g1, Goal g2 )
     : this(g0.Solver, new Goal[] { g0, g1, g2 })
 {
 }
Beispiel #4
0
 public GoalAnd( Goal g0, Goal g1 )
     : this(g0.Solver, new Goal[] { g0, g1 })
 {
 }
Beispiel #5
0
 public GoalAnd( Goal g0 )
     : this(g0.Solver, new Goal[] { g0 })
 {
 }
Beispiel #6
0
 public GoalAnd( Solver solver, Goal[] goalList )
     : base(solver)
 {
     m_GoalList		= goalList;
     m_Index			= new RevValue<int>( solver.StateStack, 0 );
 }
Beispiel #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;
        }
Beispiel #8
0
 public Goal Or( Goal g0 )
 {
     return new GoalOr( this, g0 );
 }
Beispiel #9
0
 public GoalOr( Solver solver, Goal[] goalList )
     : base(solver)
 {
     m_GoalList		= goalList;
     m_Index			= 0;
 }
Beispiel #10
0
 public void Add( Goal goal )
 {
     m_Solver.GoalStack.Add( goal );
 }
Beispiel #11
0
 public Goal And( Goal g0 )
 {
     return new GoalAnd( this, g0 );
 }
Beispiel #12
0
 public GoalAnd(Goal g0, Goal g1, Goal g2) :
     this(g0.Solver, new Goal[] { g0, g1, g2 })
 {
 }
Beispiel #13
0
 public GoalAnd(Goal g0, Goal g1) :
     this(g0.Solver, new Goal[] { g0, g1 })
 {
 }
Beispiel #14
0
 public GoalAnd(Goal g0) :
     this(g0.Solver, new Goal[] { g0 })
 {
 }
Beispiel #15
0
        public bool Solve( Goal goal )
        {
            Add( goal );
            Execute();

            m_IntObjective.Init();

            return !m_IsFailed;
        }
Beispiel #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 );
            }
        }