Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using HeuristicLab.Common;
|
---|
4 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
5 |
|
---|
6 | namespace HeuristicLab.SimulationCore {
|
---|
7 | [StorableClass]
|
---|
8 | public abstract class Activity<TModel> : IActivity<TModel> where TModel : IModel {
|
---|
9 | private IEventQueue<TModel> eventQueue;
|
---|
10 |
|
---|
11 | [Storable]
|
---|
12 | public IEventQueue<TModel> EventQueue {
|
---|
13 | get { return eventQueue; }
|
---|
14 | protected set { eventQueue = value; }
|
---|
15 | }
|
---|
16 |
|
---|
17 | public virtual IEnumerable<Type> MonitoredActions {
|
---|
18 | get { return new Type[0]; }
|
---|
19 | }
|
---|
20 |
|
---|
21 | [StorableConstructor]
|
---|
22 | protected Activity(bool deserializing) { }
|
---|
23 | protected Activity(Activity<TModel> original, Cloner cloner) {
|
---|
24 | cloner.RegisterClonedObject(original, this);
|
---|
25 | eventQueue = cloner.Clone(original.eventQueue);
|
---|
26 | }
|
---|
27 | protected Activity(IEventQueue<TModel> queue) {
|
---|
28 | eventQueue = queue;
|
---|
29 | }
|
---|
30 |
|
---|
31 | public abstract void ManageEvents(TModel model, IAction<TModel> lastAction);
|
---|
32 |
|
---|
33 | public object Clone() { return Clone(new Cloner()); }
|
---|
34 | public abstract IDeepCloneable Clone(Cloner cloner);
|
---|
35 | }
|
---|
36 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.