public Builder(RegressiveState original = default(RegressiveState)) { if (original.ranges == null) // Check for default instance { this.ranges = new Dictionary <SymbolId, ValueRange>(); } else { this.ranges = new Dictionary <SymbolId, ValueRange>(original.ranges); } }
public RegressiveState Populate(Goal goal, RegressiveState initialState = default(RegressiveState)) { var builder = initialState.BuildUpon(); foreach (var precondition in goal.Preconditions) { // IntersectRange() has the effect of merging preconditions on the same symbol builder.IntersectRange(precondition.SymbolId, precondition.AsValueRange); } return(builder.Build()); }
public static RegressiveNode MakeRegular( RegressiveState currentConstraints, WorldState initialState, INodeExpander <RegressiveNode> nodeExpander ) { return(new RegressiveNode( currentConstraints, //default(WorldState), initialState, PreconditionUtils.EnsureNotNull(nodeExpander, "nodeExpander"), false )); }
private RegressiveNode( RegressiveState currentConstraints, WorldState initialState, INodeExpander <RegressiveNode> nodeExpander, bool isTarget ) { DebugUtils.Assert( isTarget || nodeExpander != null, "Unless isTarget is true, nodeExpander must not be null" ); this.currentConstraints = currentConstraints; this.initialState = initialState; this.nodeExpander = nodeExpander; this.IsTarget = isTarget; }