/// <summary> /// Determines whether Predictor is allowed /// </summary> /// <param name="predictorID">Predictor identificator</param> private bool IsAllowedPredictorID(PredictorsProvider.PredictorID predictorID) { if (AllowedPredictorsCfg != null) { return(AllowedPredictorsCfg.IsAllowed(predictorID)); } return(false); }
/// <summary> /// Determines whether the Predictor's origin and Predictor are both allowed /// </summary> /// <param name="resName">Reservoir instance name</param> /// <param name="poolName">Pool name</param> /// <param name="predictorID">Predictor identificator</param> public bool IsAllowedPredictor(string resName, string poolName, PredictorsProvider.PredictorID predictorID) { if (IsAllowedPredictorOrigin(resName, poolName)) { return(IsAllowedPredictorID(predictorID)); } return(false); }
/// <summary> /// Checks if given predictor is enabled /// </summary> /// <param name="predictorID">Identificator of the predictor</param> public bool IsPredictorEnabled(PredictorsProvider.PredictorID predictorID) { if (_predictors != null && _predictors.IsPredictorEnabled(predictorID)) { return(true); } return(false); }
/// <summary> /// Creates an initialized instance. /// </summary> /// <param name="elem">A xml element containing the configuration data.</param> public AllowedPredictorSettings(XElement elem) { //Validation XElement settingsElem = Validate(elem, XsdTypeName); //Parsing PredictorID = (PredictorsProvider.PredictorID)Enum.Parse(typeof(PredictorsProvider.PredictorID), settingsElem.Attribute("name").Value); Check(); return; }
//Constructors /// <summary> /// Creates an initialized instance. /// </summary> /// <param name="reservoirID">An origin reservoir index.</param> /// <param name="poolID">An origin pool index.</param> /// <param name="predictorID">An identifier of the computed predictor.</param> public PredictorDescriptor(int reservoirID, int poolID, PredictorsProvider.PredictorID predictorID ) { ReservoirID = reservoirID; PoolID = poolID; PredictorID = (int)predictorID; InputFieldName = string.Empty; return; }
/// <summary> /// Check if specified predictor is allowed /// </summary> /// <param name="predictorID">Predictor ID</param> public bool IsAllowed(PredictorsProvider.PredictorID predictorID) { foreach (AllowedPredictorSettings predictorCfg in AllowedPredictorCfgCollection) { if (predictorCfg.PredictorID == predictorID) { return(true); } } return(false); }
/// <summary> /// Checks if given predictor is enabled /// </summary> /// <param name="predictorID">Enumerated predictor identifier</param> public bool IsEnabled(PredictorsProvider.PredictorID predictorID) { return(EnablingSwitchCollection[(int)predictorID]); }
//Static methods /// <summary> /// Constructs name of predictor used in xml setup /// </summary> /// <param name="predictorID">Enumerated predictor identifier</param> public static string GetXmlName(PredictorsProvider.PredictorID predictorID) { string name = predictorID.ToString(); return(name.Substring(0, 1).ToLowerInvariant() + name.Substring(1)); }
//Constructors /// <summary> /// Creates an initialized instance. /// </summary> /// <param name="predictorID">An identifier of the predictor.</param> public AllowedPredictorSettings(PredictorsProvider.PredictorID predictorID) { PredictorID = predictorID; Check(); return; }