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

            m_IntObjective.Init();

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