Ejemplo n.º 1
0
 public HSFLogData(Constraint constraint, Subsystem subsystem, Task task, double value, double timeInfo)
 {
     AssetName = constraint.Name;
     SubName = subsystem.Name;
     TaskName = task.Type.ToString();
     TargetName = task.Target.Name;
     ConstraintName = constraint.Name;
     Violation = "Constraint Failed";
     Value = value;
     TimeInfo = timeInfo;
 }
Ejemplo n.º 2
0
        public double TimeInfo { get; private set; }      // Time information 


        public HSFLogData(Subsystem subsystem, Task task, string violation, double value, double timeInfo)
        {
            AssetName = subsystem.Asset.Name;
            SubName = subsystem.Name;
            TaskName = task.Type.ToString();
            TargetName = task.Target.Name;
            ConstraintName = null;
            Violation = violation;
            Value = value;
            TimeInfo = timeInfo;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Recursivley used by CheckForCircularDependencies()
 /// </summary>
 /// <param name="currSub"></param>
 /// <param name="beginSub"></param>
 /// <returns></returns>
 private bool CheckSubForCircularDependencies(Subsystem currSub, Subsystem beginSub)
 {
     bool hasCircDep = false;
     List<Subsystem> depSubs = currSub.DependentSubsystems;
     if(depSubs.Any()){ 
         foreach(Subsystem sub in depSubs){
             hasCircDep |= sub == beginSub;
             if(hasCircDep)
                  break;
             hasCircDep |= CheckSubForCircularDependencies(sub, beginSub);
             if(hasCircDep)
                 break;
         }
     }
     return hasCircDep;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Method to check if the subsystem can perform the most recent task that was added to the schedule
        /// </summary>
        /// <param name="subsystem"></param>
        /// <param name="proposedSchedule"></param>
        /// <param name="environment"></param>
        /// <returns></returns>
        private static bool checkSub(Subsystem subsystem, SystemSchedule proposedSchedule, Universe environment)
        {
            if (subsystem.IsEvaluated)
                return true;
            var events = proposedSchedule.AllStates.Events;
            if (events.Count != 0)
            {
                //if (events.Count > 1)
                //    subsystem._oldState = events.ElementAt(events.Count - 2).State;
                //else
                //    subsystem._oldState = null;

                    if (!subsystem.CanPerform(events.Peek(), environment))
                        return false;
                    events.Peek().isEvaluated +=1;

            }
            return true;
        }