Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Controller/HiveMapper.cs @ 8817

Last change on this file since 8817 was 8817, checked in by fschoepp, 12 years ago

#1888:

  • Added a parser for independent scenarios (using the model of the optimization backend)
  • Optimization scenario sample can be found in mappings folder of the web project.
  • Added IScenarioMapper interface which provides functionality to map from the optimization data model to a backend model (e.g. Heuristic Lab data model)
  • Implementations of IScenarioMapper have to be provided as C# code (strings) which will be compiled by using a CSharpCodeProvider. Once compiled, the implementations of the IScenarioMapper are being cached within the platform for further usage.
  • Fixed a bug in web template DecimalMatrix (using i instead of j)
  • Added missing thumprint of localhost certificate to the optimization web project (ServiceConfiguration.Local.cscfg / ServiceConfiguration.Cloud.cscfg)
  • Test project now provides following test cases: Mapping types using IronPython and mapping types using Otis
File size: 594 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Data;
6
7namespace HeuristicLab.Services.Optimization.ControllerService.Model {
8  public static class HiveMapper {   
9    public static double FindDoubleValue(this InputParameters ip, string what) {     
10      foreach (var param in ip.Items) {
11        if (param.Value.Name == what) {
12          var dv = param.Value as DecimalValue;
13          //DoubleValue result = new DoubleValue(dv.Value);
14          return dv.Value;
15        }
16      }
17      return 0.0;
18    }
19  }
20}
Note: See TracBrowser for help on using the repository browser.