Ignore:
Timestamp:
07/16/19 15:23:38 (5 months ago)
Author:
gkronber
Message:

#2847: added Storable-properties to map Queues to Arrays (and vice versa) to work around problem with serialization of Queues in HEAL.Attic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/LeafBase.cs

    r17080 r17139  
    112112    public class LeafBuildingState : Item {
    113113      [Storable]
    114       public Queue<RegressionNodeModel> nodeQueue = new Queue<RegressionNodeModel>();
     114      private RegressionNodeModel[] storableNodeQueue { get { return nodeQueue.ToArray(); } set { nodeQueue = new Queue<RegressionNodeModel>(value); } }
     115      public Queue<RegressionNodeModel> nodeQueue;
    115116      [Storable]
    116       public Queue<IReadOnlyList<int>> trainingRowsQueue = new Queue<IReadOnlyList<int>>();
     117      private IReadOnlyList<int>[] storabletrainingRowsQueue { get { return trainingRowsQueue.ToArray(); } set { trainingRowsQueue = new Queue<IReadOnlyList<int>>(value); } }
     118      public Queue<IReadOnlyList<int>> trainingRowsQueue;
    117119
    118120      //State.Code values denote the current action (for pausing)
     
    130132        Code = original.Code;
    131133      }
    132       public LeafBuildingState() { }
     134      public LeafBuildingState() {
     135        nodeQueue = new Queue<RegressionNodeModel>();
     136        trainingRowsQueue = new Queue<IReadOnlyList<int>>();
     137      }
    133138      public override IDeepCloneable Clone(Cloner cloner) {
    134139        return new LeafBuildingState(this, cloner);
Note: See TracChangeset for help on using the changeset viewer.