public Goal Copy( Goal other ) { Goal copy; if( !m_GoalMap.TryGetValue( other, out copy ) ) { copy = other.Copy( this ); m_GoalMap[ other ] = copy; } return copy; }
public bool Solve( Goal goal ) { return m_GoalStack.Solve( goal ); }
public GoalAnd( Goal g0, Goal g1, Goal g2 ) : this(g0.Solver, new Goal[] { g0, g1, g2 }) { }
public GoalAnd( Goal g0, Goal g1 ) : this(g0.Solver, new Goal[] { g0, g1 }) { }
public GoalAnd( Goal g0 ) : this(g0.Solver, new Goal[] { g0 }) { }
public GoalAnd( Solver solver, Goal[] goalList ) : base(solver) { m_GoalList = goalList; m_Index = new RevValue<int>( solver.StateStack, 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; }
public Goal Or( Goal g0 ) { return new GoalOr( this, g0 ); }
public GoalOr( Solver solver, Goal[] goalList ) : base(solver) { m_GoalList = goalList; m_Index = 0; }
public void Add( Goal goal ) { m_Solver.GoalStack.Add( goal ); }
public Goal And( Goal g0 ) { return new GoalAnd( this, g0 ); }
public GoalAnd(Goal g0, Goal g1, Goal g2) : this(g0.Solver, new Goal[] { g0, g1, g2 }) { }
public GoalAnd(Goal g0, Goal g1) : this(g0.Solver, new Goal[] { g0, g1 }) { }
public GoalAnd(Goal g0) : this(g0.Solver, new Goal[] { g0 }) { }
public bool Solve( Goal goal ) { Add( goal ); Execute(); m_IntObjective.Init(); return !m_IsFailed; }
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 ); } }