Last change
on this file since 17266 was
17266,
checked in by dpiringe, 5 years ago
|
#3026:
- changed the namespace from ParameterTest to HeuristicLab.Manufacture
- added an extension method for Type to get the distance of an interface based on the target type
- renamed methods ToData, SetValue to Extract, Inject
- new implementation of the template generation with transformers (not the final name)
- started to use the new transformers for the instantiation of IOptimizer-objects (out of a template)
- new transformers: LookupParameterTransformer and DummyTransformer
|
File size:
584 bytes
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 | using HeuristicLab.Core;
|
---|
7 | using HeuristicLab.Data;
|
---|
8 |
|
---|
9 | namespace HeuristicLab.Manufacture {
|
---|
10 | public class StringValueTransformer : BaseTransformer {
|
---|
11 | public override void InjectData(IItem item, ParameterData data) =>
|
---|
12 | item.Cast<StringValue>().Value = CastValue<string>(data.Default);
|
---|
13 |
|
---|
14 | public override ParameterData ExtractData(IItem value) =>
|
---|
15 | new ParameterData() {
|
---|
16 | Default = value.Cast<StringValue>().Value
|
---|
17 | };
|
---|
18 | }
|
---|
19 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.