コード例 #1
0
ファイル: HSFLogData.cs プロジェクト: emehiel/Horizon
 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;
 }
コード例 #2
0
ファイル: Checker.cs プロジェクト: emehiel/Horizon
 /// <summary>
 /// Check if the constraint has been violated in progressing the state of the system
 /// </summary>
 /// <param name="system"></param>
 /// <param name="proposedSchedule"></param>
 /// <param name="constraint"></param>
 /// <returns></returns>
 private static bool CheckConstraints(SystemClass system, SystemSchedule proposedSchedule, Constraint constraint)
 {
     if (!constraint.Accepts(proposedSchedule.AllStates.GetLastState()))
     {
         // TODO: Change this to logger
         // HSFLogger.Log(new HSFLogData(constraint, subsystem, task, value, time));
         Console.WriteLine("Constraint Failed");
         return false;
     }
     return true;
 }