Last change
on this file since 8674 was
8670,
checked in by svonolfe, 12 years ago
|
Added first version of the dynamic vehicle routing addon (#1955)
|
File size:
963 bytes
|
Rev | Line | |
---|
[8670] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using HeuristicLab.Core;
|
---|
| 6 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 7 | using HeuristicLab.Common;
|
---|
| 8 |
|
---|
| 9 | namespace HeuristicLab.PDPSimulation.DomainModel {
|
---|
| 10 | [StorableClass]
|
---|
| 11 | public abstract class BaseObject: Item {
|
---|
| 12 | [Storable]
|
---|
| 13 | public Guid Id { get; set; }
|
---|
| 14 |
|
---|
| 15 | public BaseObject() {
|
---|
| 16 | Id = Guid.NewGuid();
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | [StorableConstructor]
|
---|
| 20 | protected BaseObject(bool deserializing) : base(deserializing) { }
|
---|
| 21 | protected BaseObject(BaseObject original, Cloner cloner)
|
---|
| 22 | : base(original, cloner) {
|
---|
| 23 | Id = original.Id;
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | public override bool Equals(object obj) {
|
---|
| 27 | if (obj is BaseObject) {
|
---|
| 28 | return Id == (obj as BaseObject).Id;
|
---|
| 29 | } else {
|
---|
| 30 | return base.Equals(obj);
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | public override int GetHashCode() {
|
---|
| 35 | return Id.GetHashCode();
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.