using System.Collections.Generic;
using HeuristicLab.Common;
using HeuristicLab.Core;
using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
namespace HeuristicLab.Problems.ProgramSynthesis {
[StorableClass]
public class ErcOptions : NamedItem, IReadOnlyErcOptions {
public ErcOptions() {
Name = "ERC Options";
ErcProbability = 0d;
IntegerErcOptions = new IntegerErcOptions();
FloatErcOptions = new FloatErcOptions();
BooleanErcOptions = new BooleanErcOptions();
CharErcOptions = new CharErcOptions();
StringErcOptions = new StringErcOptions();
NameErcOptions = new NameErcOptions();
IntegerVectorErcOptions = new IntegerVectorErcOptions();
StringVectorErcOptions = new StringVectorErcOptions();
FloatVectorErcOptions = new FloatVectorErcOptions();
}
[StorableConstructor]
protected ErcOptions(bool deserializing)
: base(deserializing) {
}
public ErcOptions(ErcOptions origin, Cloner cloner)
: base(origin, cloner) {
ErcProbability = origin.ErcProbability;
IntegerErcOptions = cloner.Clone(origin.IntegerErcOptions);
FloatErcOptions = cloner.Clone(origin.FloatErcOptions);
BooleanErcOptions = cloner.Clone(origin.BooleanErcOptions);
CharErcOptions = cloner.Clone(origin.CharErcOptions);
StringErcOptions = cloner.Clone(origin.StringErcOptions);
NameErcOptions = cloner.Clone(origin.NameErcOptions);
IntegerVectorErcOptions = cloner.Clone(origin.IntegerVectorErcOptions);
StringVectorErcOptions = cloner.Clone(origin.StringVectorErcOptions);
FloatVectorErcOptions = cloner.Clone(origin.FloatVectorErcOptions);
}
[Storable]
public double ErcProbability { get; set; }
[Storable]
public IntegerErcOptions IntegerErcOptions { get; set; }
[Storable]
public FloatErcOptions FloatErcOptions { get; set; }
///
/// Integer represents ASCII value
///
[Storable]
public CharErcOptions CharErcOptions { get; set; }
[Storable]
public BooleanErcOptions BooleanErcOptions { get; set; }
[Storable]
public StringErcOptions StringErcOptions { get; set; }
[Storable]
public NameErcOptions NameErcOptions { get; set; }
[Storable]
public IntegerVectorErcOptions IntegerVectorErcOptions { get; set; }
[Storable]
public StringVectorErcOptions StringVectorErcOptions { get; set; }
[Storable]
public FloatVectorErcOptions FloatVectorErcOptions { get; set; }
IErcItem IReadOnlyErcOptions.IntegerErcOptions {
get {
return IntegerErcOptions;
}
}
IErcItem IReadOnlyErcOptions.FloatErcOptions {
get {
return FloatErcOptions;
}
}
IErcItem IReadOnlyErcOptions.BooleanErcOptions {
get {
return BooleanErcOptions;
}
}
IErcItem IReadOnlyErcOptions.CharErcOptions {
get {
return CharErcOptions;
}
}
IErcItem IReadOnlyErcOptions.StringErcOptions {
get {
return StringErcOptions;
}
}
IErcItem IReadOnlyErcOptions.NameErcOptions {
get {
return NameErcOptions;
}
}
IErcItem> IReadOnlyErcOptions.IntegerVectorErcOptions {
get {
return IntegerVectorErcOptions;
}
}
IErcItem> IReadOnlyErcOptions.FloatVectorErcOptions {
get {
return FloatVectorErcOptions;
}
}
IErcItem> IReadOnlyErcOptions.StringVectorErcOptions {
get {
return StringVectorErcOptions;
}
}
public override IDeepCloneable Clone(Cloner cloner) {
return new ErcOptions(this, cloner);
}
public void DisableAllOptions() {
SetOptionsState(false);
}
public void EnableAllOptions() {
SetOptionsState(true);
}
public void SetOptionsState(bool state) {
IntegerErcOptions.IsEnabled = state;
FloatErcOptions.IsEnabled = state;
CharErcOptions.IsEnabled = state;
BooleanErcOptions.IsEnabled = state;
StringErcOptions.IsEnabled = state;
NameErcOptions.IsEnabled = state;
IntegerVectorErcOptions.IsEnabled = state;
FloatVectorErcOptions.IsEnabled = state;
StringVectorErcOptions.IsEnabled = state;
}
}
}