Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/13/10 06:41:56 (14 years ago)
Author:
swagner
Message:

Implemented ReadOnlyView property for items (#969).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/PathTSPTour.cs

    r3306 r3317  
    3939    }
    4040
     41    [Storable]
    4142    private DoubleMatrix coordinates;
    42     [Storable]
    4343    public DoubleMatrix Coordinates {
    4444      get { return coordinates; }
     
    5252      }
    5353    }
     54    [Storable]
    5455    private Permutation permutation;
    55     [Storable]
    5656    public Permutation Permutation {
    5757      get { return permutation; }
     
    6969    public PathTSPTour(DoubleMatrix coordinates)
    7070      : base() {
    71       Coordinates = coordinates;
     71      this.coordinates = coordinates;
     72      Initialize();
    7273    }
    7374    public PathTSPTour(DoubleMatrix coordinates, Permutation permutation)
    74       : this(coordinates) {
    75       Permutation = permutation;
     75      : base() {
     76      this.coordinates = coordinates;
     77      this.permutation = permutation;
     78      Initialize();
     79    }
     80    [StorableConstructor]
     81    private PathTSPTour(bool deserializing) : base(deserializing) { }
     82
     83    [StorableHook(HookType.AfterDeserialization)]
     84    private void Initialize() {
     85      if (coordinates != null) RegisterCoordinatesEvents();
     86      if (permutation != null) RegisterPermutationEvents();
    7687    }
    7788
     
    7990      PathTSPTour clone = new PathTSPTour();
    8091      cloner.RegisterClonedObject(this, clone);
    81       clone.Coordinates = (DoubleMatrix)cloner.Clone(coordinates);
    82       clone.Permutation = (Permutation)cloner.Clone(permutation);
     92      clone.ReadOnlyView = ReadOnlyView;
     93      clone.coordinates = (DoubleMatrix)cloner.Clone(coordinates);
     94      clone.permutation = (Permutation)cloner.Clone(permutation);
     95      clone.Initialize();
    8396      return clone;
    8497    }
Note: See TracChangeset for help on using the changeset viewer.