Example #1
0
        public static object SolverWeightedSumsFactoryTimes(object arg0)
        {
            var f   = (WeightedSums.Factory)arg0;
            int n   = f.itemsCount;
            var res = new ITimedObject[n];
            var ts  = f.timeStep;
            var beg = f.begTime;

            for (int i = 0; i < n; i++)
            {
                res[i] = new TimedString(DateTime.FromOADate(beg + ts * i), DateTime.FromOADate(beg + ts * (i + 1)), string.Empty);
            }
            return(res);
        }
Example #2
0
        public static object SolverTimesOfIDicts([CanBeVector] object arg0)
        {
            var idicts = Utils.AsIList(arg0);
            int n      = idicts.Count;
            var res    = new ITimedObject[n];

            for (int i = 0; i < n; i++)
            {
                var r = idicts[i] as IIndexedDict;
                if (r != null)
                {
                    var maxBegTime = DateTime.MinValue;
                    var minEndTime = DateTime.MaxValue;
                    foreach (ITimedObject to in r.ValuesList)
                    {
                        if (to == null)
                        {
                            continue;
                        }
                        if (maxBegTime < to.Time)
                        {
                            maxBegTime = to.Time;
                        }
                        if (to.EndTime < minEndTime)
                        {
                            minEndTime = to.EndTime;
                        }
                    }
                    res[i] = new TimedString(maxBegTime, minEndTime, string.Empty);
                }
                else
                {
                    res[i] = TimedObject.FullRangeI;
                }
            }
            return(res);
        }
Example #3
0
 ///<exclude/>
 public bool Equals(TimedString other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other._Tm.Equals(_Tm) && other._Data == (_Data);
 }