コード例 #1
0
        /// <summary>
        /// Starts all components
        /// </summary>
        /// <param name="time">Start time</param>
        public virtual void StartAll(double time)
        {
            provider.Time = time;
            List <IStarted> ls = new List <IStarted>();

            collection.ForEach <IStarted>((IStarted s) => { ls.Add(s); s.Start(time); });
            IStep st = this;

            st.Step = -1;
            IDifferentialEquationProcessor pr = DifferentialEquationProcessor.Processor;

            if (pr == null)
            {
                return;
            }
            ICollection <IDifferentialEquationSolver> de = pr.Equations;

            foreach (IDifferentialEquationSolver deq in de)
            {
                if (deq is IStarted)
                {
                    IStarted s = deq as IStarted;
                    if (!ls.Contains(s))
                    {
                        s.Start(time);
                    }
                }
            }
            dynamical.ForEach((IDynamical dyn) => { dyn.Time = time; });
        }
コード例 #2
0
        /// <summary>
        /// Initialization
        /// </summary>
        protected virtual void Init()
        {
            List <IAggregableMechanicalObject> lo = new List <IAggregableMechanicalObject>();

            foreach (AggregableWrapper aw in aggrWrappres)
            {
                lo.Add(aw.Aggregate);
            }
            aggregates = lo.ToArray();
            indexes    = new int[aggrWrappres.Length];
            int kn = 0;
            int nn = 0;

            for (int i = 0; i < indexes.Length; i++)
            {
                int dd = aggrWrappres[i].Aggregate.Dimension;
                indexes[i] = kn;
                kn        += aggrWrappres[i].Aggregate.Dimension;
                nn        += dd;
            }
            derivations = new double[nn, 2];
            foreach (IAggregableMechanicalObject amo in aggregates)
            {
                if (amo is IStarted)
                {
                    IStarted st = amo as IStarted;
                    st.Start(0);
                }
            }
            IDifferentialEquationSolver s = this;

            Set(ref measures, derivations);
            s.CalculateDerivations();
        }
コード例 #3
0
 int IComparer <IStarted> .Compare(IStarted x, IStarted y)
 {
     if ((x is IMeasurements) & (y is IMeasurements))
     {
         IComparer <IMeasurements> c = this;
         return(c.Compare(x as IMeasurements, y as IMeasurements));
     }
     return(0);
 }
コード例 #4
0
        //*/

        #region IStarted Members

        void IStarted.Start(double time)
        {
            foreach (IMeasurements m in mea)
            {
                if (m is IStarted)
                {
                    IStarted st = m as IStarted;
                    st.Start(time);
                }
            }
        }
コード例 #5
0
ファイル: AccumulatorBase.cs プロジェクト: Erroman/universal
 private void start(double time)
 {
     foreach (object o in dep)
     {
         if (o is IStarted)
         {
             IStarted s = o as IStarted;
             s.Start(time);
         }
     }
 }
コード例 #6
0
        void IStarted.Start(double time)
        {
            Reset();
            if (aggregate is IStarted)
            {
                IStarted s = aggregate as IStarted;
                s.Start(time);
            }

            Normalize(aggregate);
            IDifferentialEquationSolver so = this;

            so.CalculateDerivations();
        }
コード例 #7
0
 /// <summary>
 /// Starts all components
 /// </summary>
 /// <param name="time">Start time</param>
 public override void StartAll(double time)
 {
     base.StartAll(time);
     if (coll != null)
     {
         foreach (IDifferentialEquationSolver so in coll)
         {
             if (so is IStarted)
             {
                 IStarted s = so as IStarted;
                 s.Start(time);
             }
         }
     }
     frames.UpdateFrames();
     if (frames.Count == 0)
     {
         updateInternal = base.UpdateAll;
     }
     else
     {
         updateInternal = UpdateWithFrames;
     }
 }
コード例 #8
0
ファイル: RemoteMind.cs プロジェクト: JvJ/Fatima
 public void ActionStarted(IStarted evt)
 {
     EntityAction<ActionParameters> action = evt.Action as EntityAction<ActionParameters>;
     if (action != null)
     {
         Console.WriteLine("-- RemoteCharacter.ActionStarted " + action.Name);
         if (this.receiverAlive)
         {
             Send(ACTION_STARTED + " " + action.StartArguments.ToXML());
         }
     }
 }