コード例 #1
0
        public void AddShiftedFunction(Func <IContinuousFunction> function, IControlParameter horizontalShift, IControlParameter verticalShift,
                                       Domain domain, string name)
        {
            ShiftDecorator shifted() => new ShiftDecorator(function(), horizontalShift, verticalShift);

            AddFunction(shifted, domain, name);
        }
コード例 #2
0
        private void CanControlParameterResponse(CanControlEventArgs e)
        {
            object[]          P         = (object[])e.State;
            string            From      = (string)P [0];
            Session           Session   = (Session)P [1];
            IControlParameter Parameter = (IControlParameter)P [2];
            string            Name      = (string)P [3];
            string            Value     = (string)P [4];

            if (e.Result && Array.IndexOf <string> (e.Parameters, Name) >= 0)
            {
                string Msg = Parameter.Import(Value);

                if (Msg == null)
                {
                    this.client.SendMessage(From, Name + "=" + Value, MessageType.Chat);
                }
                else
                {
                    this.SendErrorMessage(From, Msg, Session);
                }
            }
            else
            {
                this.SendErrorMessage(From, "Request rejected by provisioning server.", Session);
            }
        }
コード例 #3
0
 public ExtendedParameterSet(IControlParameter w, IControlParameter c1, IControlParameter c2, IControlParameter c3, double lambda)
 {
     InertiaWeight         = w;
     CognitiveAcceleration = c1;
     SocialAcceleration    = c2;
     ExtendedAcceleration  = c3;
     Lambda = lambda;
 }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="function"></param>
        /// <param name="horizontalShift"></param>
        /// <param name="verticalShift"></param>
        /// <param name="rotationType"></param>
        /// <param name="condition">The condition number to be used for linear-transformation rotation. If any other type of rotation is used, condition should be set to 1.</param>
        /// <param name="domain"></param>
        /// <param name="name"></param>
        public void AddShiftedRotatedFunction(Func <IContinuousFunction> function, IControlParameter horizontalShift, IControlParameter verticalShift,
                                              RotationType rotationType, int condition, Domain domain, string name)
        {
            RotationDecorator rotated() => new RotationDecorator(function())
            {
                RotationType = rotationType,
                Condition    = condition
            };

            ShiftDecorator shifted() => new ShiftDecorator(rotated(), horizontalShift, verticalShift);

            AddFunction(shifted, domain, name);
        }
コード例 #5
0
 public ShiftDecorator(IContinuousFunction function, IControlParameter horizontalShift, IControlParameter verticalShift)
 {
     Function        = function;
     HorizontalShift = horizontalShift;
     VerticalShift   = verticalShift;
 }
コード例 #6
0
 public StandardParameterSet(IControlParameter w, IControlParameter c1, IControlParameter c2)
 {
     InertiaWeight         = w;
     CognitiveAcceleration = c1;
     SocialAcceleration    = c2;
 }
コード例 #7
0
 public PeriodicDetection()
 {
     Period = new ConstantControlParameter(5);
 }
コード例 #8
0
 public NoisyDecorator()
 {
     noise  = new GaussianDistribution();
     Scale  = new ConstantControlParameter(0.4);
     Offset = new ConstantControlParameter(1);
 }
コード例 #9
0
 public GaussianDistribution(IControlParameter mean, IControlParameter standardDeviation)
 {
     Mean = mean;
     StandardDeviation = standardDeviation;
 }
コード例 #10
0
 public UniformDistribution(IControlParameter lowerBound, IControlParameter upperBound)
 {
     LowerBound = lowerBound;
     UpperBound = upperBound;
 }