Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
0
        /// <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;
        }
Ejemplo n.º 5
0
 //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;
 }
Ejemplo n.º 6
0
 /// <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);
 }
Ejemplo n.º 7
0
 /// <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]);
 }
Ejemplo n.º 8
0
        //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));
        }
Ejemplo n.º 9
0
 //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;
 }