示例#1
0
文件: Event.cs 项目: nasa03/Jasonity
        public Event Clone()
        {
            Trigger   tc = (trigger == null ? null : trigger.Clone());
            Intention ic = (intention == null ? null : intention.Clone());

            return(new Event(tc, ic));
        }
示例#2
0
        public Intention Clone()
        {
            Intention i = new Intention();

            i.id          = id;
            i.atomicCount = atomicCount;
            i.plans       = new List <IntendedPlan>();
            foreach (IntendedPlan ip in plans)
            {
                i.plans.Add((IntendedPlan)ip.Clone());
            }
            return(i);
        }
示例#3
0
        // Implements atomic intentions greater than non-atomic intentions
        public int CompareTo(Intention o)
        {
            if (o.atomicCount > atomicCount)
            {
                return(1);
            }
            if (atomicCount > o.atomicCount)
            {
                return(-1);
            }

            if (o.id > id)
            {
                return(1);
            }
            if (id > o.id)
            {
                return(-1);
            }
            return(0);
        }
示例#4
0
 // Used by fork
 public void CopyTo(Intention i)
 {
     i.atomicCount = atomicCount;
     i.plans       = new List <IntendedPlan>(plans);
 }
示例#5
0
文件: Event.cs 项目: nasa03/Jasonity
 public Event(Trigger t, Intention i)
 {
     trigger   = t;
     intention = i;
 }
示例#6
0
文件: Event.cs 项目: nasa03/Jasonity
 public void SetIntention(Intention i)
 {
     intention = i;
 }