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); }
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); } }
public ExtendedParameterSet(IControlParameter w, IControlParameter c1, IControlParameter c2, IControlParameter c3, double lambda) { InertiaWeight = w; CognitiveAcceleration = c1; SocialAcceleration = c2; ExtendedAcceleration = c3; Lambda = lambda; }
/// <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); }
public ShiftDecorator(IContinuousFunction function, IControlParameter horizontalShift, IControlParameter verticalShift) { Function = function; HorizontalShift = horizontalShift; VerticalShift = verticalShift; }
public StandardParameterSet(IControlParameter w, IControlParameter c1, IControlParameter c2) { InertiaWeight = w; CognitiveAcceleration = c1; SocialAcceleration = c2; }
public PeriodicDetection() { Period = new ConstantControlParameter(5); }
public NoisyDecorator() { noise = new GaussianDistribution(); Scale = new ConstantControlParameter(0.4); Offset = new ConstantControlParameter(1); }
public GaussianDistribution(IControlParameter mean, IControlParameter standardDeviation) { Mean = mean; StandardDeviation = standardDeviation; }
public UniformDistribution(IControlParameter lowerBound, IControlParameter upperBound) { LowerBound = lowerBound; UpperBound = upperBound; }