Free cookie consent management tool by TermsFeed Policy Generator

source: branches/SimulationCore/HeuristicLab.SimulationCore/3.3/DiscreteEvent/Action.cs @ 10450

Last change on this file since 10450 was 10450, checked in by abeham, 10 years ago

#1610: Added a base infrastructure for discrete event simulation

File size: 1.0 KB
Line 
1using System;
2using HeuristicLab.Common;
3using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
4
5namespace HeuristicLab.SimulationCore {
6  [StorableClass]
7  public abstract class Action<TModel> : IAction<TModel> where TModel : IModel {
8    public abstract Guid ActionId { get; }
9    public IActivity<TModel> Mandate { get; protected set; }
10
11    [Storable]
12    private IActivity<TModel> StorableMandate {
13      get { return Mandate; }
14      set { Mandate = value; }
15    }
16
17    [StorableConstructor]
18    protected Action(bool deserializing) { }
19    protected Action(Action<TModel> original, Cloner cloner) {
20      cloner.RegisterClonedObject(original, this);
21      Mandate = cloner.Clone(original.Mandate);
22    }
23    protected Action() { }
24    protected Action(IActivity<TModel> mandate) {
25      Mandate = mandate;
26    }
27
28    public abstract void Execute(TModel model);
29
30    public object Clone() { return Clone(new Cloner()); }
31    public abstract IDeepCloneable Clone(Cloner cloner);
32  }
33}
Note: See TracBrowser for help on using the repository browser.