Ejemplo n.º 1
0
        // Creates a clone of the state.
        public Object Clone()
        {
            List <Hashtable> newApplicables = new List <Hashtable>();

            foreach (Hashtable applicable in applicables)
            {
                newApplicables.Add((Hashtable)applicable.Clone());
            }

            Operator newLastStep = new Operator();

            if (lastStep != null)
            {
                newLastStep = lastStep.Clone() as Operator;
            }

            Operator newNextStep = new Operator();

            if (nextStep != null)
            {
                newNextStep = nextStep.Clone() as Operator;
            }

            return(new State((Hashtable)table.Clone(), newLastStep, newNextStep, newApplicables));
        }
Ejemplo n.º 2
0
        // Create a clone of the causal link.
        public Object Clone()
        {
            List <IOperator> newSpan = new List <IOperator>();

            foreach (Operator op in Span)
            {
                newSpan.Add(op.Clone() as Operator);
            }

            return(new CausalLink((Predicate)predicate.Clone(), (Operator)head.Clone(), (Operator)tail.Clone(), newSpan));
        }