#region License Information /* HeuristicLab * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using System.Linq; using System.Text; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; using HeuristicLab.Common; namespace HeuristicLab.PDPSimulation.DomainModel { public enum VehicleState { Parked, Waiting, InvalidAction, Moving, Servicing } [StorableClass] public class Vehicle: BaseObject { //State [Storable] public VehicleState VehicleState { get; set; } [Storable] public List PickedUpOrders { get; set; } [Storable] public double PositionX { get; set; } [Storable] public double PositionY { get; set; } [Storable] public double Overload { get; set; } [Storable] public double Distance { get; set; } [Storable] public double Capacity { get; set; } [Storable] public double ReadyTime { get; set; } [Storable] public int InvalidActions { get; set; } [Storable] public double Tardiness { get; set; } [Storable] public double TargetPositionX { get; set; } [Storable] public double TargetPositionY { get; set; } [Storable] public Guid CurrentOrder { get; set; } [Storable] public VehicleAction CurrentAction { get; set; } [Storable] public int Availibility { get; set; } [StorableClass] public class MoveInformation { [Storable] public int Segment { get; set; } [Storable] public int Source { get; set; } [Storable] public int Dest { get; set; } public object Path { get; set; } } [Storable] public MoveInformation MoveInfo { get; set; } //Data [Storable] public string Name { get; set; } [Storable] public double TotalCapacity { get; set; } [Storable] public double DepotX { get; set; } [Storable] public double DepotY { get; set; } [Storable] public double DueTime { get; set; } public Vehicle() : base() { PickedUpOrders = new List(); MoveInfo = new MoveInformation(); } [StorableConstructor] private Vehicle(bool deserializing) : base(deserializing) { } private Vehicle(Vehicle original, Cloner cloner) : base(original, cloner) { VehicleState = original.VehicleState; PickedUpOrders = new List(original.PickedUpOrders); PositionX = original.PositionX; PositionY = original.PositionY; Overload = original.Overload; Distance = original.Distance; DepotX = original.DepotX; DepotY = original.DepotY; Capacity = original.Capacity; ReadyTime = original.ReadyTime; DueTime = original.DueTime; InvalidActions = original.InvalidActions; Tardiness = original.Tardiness; TargetPositionX = original.TargetPositionX; TargetPositionY = original.TargetPositionY; CurrentOrder = original.CurrentOrder; CurrentAction = original.CurrentAction; TotalCapacity = original.TotalCapacity; MoveInfo = new MoveInformation(); MoveInfo.Source = original.MoveInfo.Source; MoveInfo.Dest = original.MoveInfo.Dest; MoveInfo.Segment = original.MoveInfo.Segment; Availibility = original.Availibility; Name = original.Name; } public override IDeepCloneable Clone(Cloner cloner) { return new Vehicle(this, cloner); } } }