/// <summary> /// Checks if the runtime of an allocation exceeds the maximum program duration /// </summary> /// <returns> /// An empty string if the runtime is valid, /// an error message if invalid /// </returns> /// <param name="configFileContent">Content of a configuration file</param> /// <param name="allocationRuntime">Runtime of an allocation</param> public static string IsAllocationRuntimeValid(string configFileContent, float allocationRuntime) { string errorMsg = "Runtime of the given allocation exceeds maximum duration of the program."; float maxDuration = ConfigFileParser.GetMaximumDuration(configFileContent); return(allocationRuntime <= maxDuration ? "" : errorMsg); }
public ConfigFile(string configFileContent) { this.content = configFileContent; this.maxDuration = ConfigFileParser.GetMaximumDuration(configFileContent); this.refFrequency = ConfigFileParser.GetRuntimeReferenceFrequency(configFileContent); this.tasks = ConfigFileParser.GetTasks(configFileContent); this.processors = ConfigFileParser.GetProcessors(configFileContent); this.coefficients = ConfigFileParser.GetCoefficients(configFileContent); }