Example #1
0
 /// <summary>Create a constant parameter with the default value.</summary>
 /// <param name="description"></param>
 public ConstantParameter(ParameterDescription description)
     : this(description, 
         // have to map the default value in the description to our internal [0, 1] range
         (float)description.Max == description.Min 
             ? description.Default 
             : ((description.Default - description.Min) / (description.Max - description.Min)), 
         false)
 {
 }
Example #2
0
        public ConstantParameter(ParameterDescription description, float value, bool immutable)
            : base(description)
        {
            HoloDebug.Assert(0 <= value);
            HoloDebug.Assert(value <= 1);

            m_value = value;
            m_immutable = immutable;
        }
 static ParameterMap Map2(ParameterDescription description1, float value1, ParameterDescription description2, float value2)
 {
     return new ParameterMap().Add(new ConstantParameter(description1, value1, false))
         .Add(new ConstantParameter(description2, value2, false));
 }
 static ParameterMap Map(ParameterDescription description, float value)
 {
     return new ParameterMap().Add(new ConstantParameter(description, value, false));
 }
Example #5
0
 public void Increment(ParameterDescription d)
 {
     m_counters[d] = m_counters[d] + 1;
 }
Example #6
0
 public int this[ParameterDescription d]
 {
     get { return m_counters[d]; }
 }
Example #7
0
 protected Parameter(ParameterDescription description)
 {
     m_description = description;
 }