namespace HeuristicLab.Problems.ProgramSynthesis.Base.Erc {
using System.Collections.Generic;
using HeuristicLab.Common;
using HeuristicLab.Core;
using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Boolean;
using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Char;
using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Float;
using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.FloatVector;
using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer;
using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.IntegerVector;
using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Name;
using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.String;
using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.StringVector;
[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;
}
}
}