#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.Data; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; using HeuristicLab.Core; using HeuristicLab.Common; namespace HeuristicLab.Problems.Scheduling { [Item("Task Class", "Represents a task that has been scheduled already.")] [StorableClass] public class Task : Item { [StorableConstructor] protected Task(bool deserializing) : base(deserializing) { } protected Task(Task original, Cloner cloner) : base(original, cloner) { this.ResourceNr = cloner.Clone(original.ResourceNr); this.JobNr = cloner.Clone(original.JobNr); this.Duration = cloner.Clone(original.Duration); this.TaskNr = cloner.Clone(original.TaskNr); this.IsScheduled = cloner.Clone(original.IsScheduled); } public override IDeepCloneable Clone(Cloner cloner) { return new Task(this, cloner); } public IntValue TaskNr { get; set; } public IntValue ResourceNr { get; set; } public IntValue JobNr { get; set; } public DoubleValue Duration { get; set; } public BoolValue IsScheduled { get; set; } public Task (int taskNr, int resNr, int jobNr, double duration) : base () { Duration = new DoubleValue (duration); ResourceNr = new IntValue (resNr); JobNr = new IntValue (jobNr); TaskNr = new IntValue (taskNr); IsScheduled = new BoolValue(false); } public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("[" + TaskNr + "," + ResourceNr + "]"); return sb.ToString(); } } }