Last change
on this file since 16300 was
15018,
checked in by gkronber, 8 years ago
|
#2520 introduced StorableConstructorFlag type for StorableConstructors
|
File size:
1.3 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Diagnostics.Contracts;
|
---|
4 | using System.Linq;
|
---|
5 | using System.Text;
|
---|
6 | using System.Threading.Tasks;
|
---|
7 | using HeuristicLab.Common;
|
---|
8 | using HeuristicLab.Core;
|
---|
9 | using HeuristicLab.Persistence;
|
---|
10 |
|
---|
11 | namespace HeuristicLab.Algorithms.DataAnalysis.MctsSymbolicRegression.Policies {
|
---|
12 | [StorableType("d2a06cc9-6b72-47aa-9d41-4aa814d002d9")]
|
---|
13 | public abstract class PolicyBase : Item, IParameterizedItem, IPolicy {
|
---|
14 | [Storable]
|
---|
15 | public IKeyedItemCollection<string, IParameter> Parameters { get; private set; }
|
---|
16 |
|
---|
17 | [StorableConstructor]
|
---|
18 | protected PolicyBase(StorableConstructorFlag deserializing) : base(deserializing) { }
|
---|
19 | protected PolicyBase(PolicyBase original, Cloner cloner)
|
---|
20 | : base(original, cloner) {
|
---|
21 | Parameters = cloner.Clone(original.Parameters);
|
---|
22 | }
|
---|
23 | protected PolicyBase()
|
---|
24 | : base() {
|
---|
25 | Parameters = new ParameterCollection();
|
---|
26 | }
|
---|
27 |
|
---|
28 | public void CollectParameterValues(IDictionary<string, IItem> values) {
|
---|
29 | foreach (var p in Parameters) values.Add(this.ItemName + "." + p.Name, p.ActualValue);
|
---|
30 | }
|
---|
31 |
|
---|
32 | public abstract int Select(IEnumerable<IActionStatistics> actions, IRandom random);
|
---|
33 | public abstract void Update(IActionStatistics action, double q);
|
---|
34 | public abstract IActionStatistics CreateActionStatistics();
|
---|
35 | }
|
---|
36 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.