Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6936


Ignore:
Timestamp:
10/24/11 18:50:26 (12 years ago)
Author:
abeham
Message:

#1619

  • Added a new service method and a helper class for calling the service and configuring a QAP instance
  • Made parameter properties of the RTS public (so that it can be configured programmatically)
Location:
branches/GeneralizedQAP
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.MainForm.WindowsForms/3.3/HeuristicLab.MainForm.WindowsForms-3.3.csproj

    r6878 r6936  
    140140    <None Include="Plugin.cs.frame" />
    141141    <Compile Include="Controls\ControlExtensions.cs" />
    142     <Compile Include="MainForms\DockForm.cs">
    143       <SubType>Form</SubType>
    144     </Compile>
     142    <Compile Include="MainForms\DockForm.cs" />
    145143    <Compile Include="MainForms\DockForm.Designer.cs">
    146144      <DependentUpon>DockForm.cs</DependentUpon>
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Algorithms/3.3/RobustTabooSearch.cs

    r6628 r6936  
    5151
    5252    #region Parameter Properties
    53     private FixedValueParameter<MultiAnalyzer> AnalyzerParameter {
     53    public FixedValueParameter<MultiAnalyzer> AnalyzerParameter {
    5454      get { return (FixedValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
    5555    }
    56     private FixedValueParameter<IntValue> SeedParameter {
     56    public FixedValueParameter<IntValue> SeedParameter {
    5757      get { return (FixedValueParameter<IntValue>)Parameters["Seed"]; }
    5858    }
    59     private FixedValueParameter<BoolValue> SetSeedRandomlyParameter {
     59    public FixedValueParameter<BoolValue> SetSeedRandomlyParameter {
    6060      get { return (FixedValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
    6161    }
    62     private FixedValueParameter<IntValue> MaximumIterationsParameter {
     62    public FixedValueParameter<IntValue> MaximumIterationsParameter {
    6363      get { return (FixedValueParameter<IntValue>)Parameters["MaximumIterations"]; }
    6464    }
    65     private FixedValueParameter<IntValue> MinimumTabuTenureParameter {
     65    public FixedValueParameter<IntValue> MinimumTabuTenureParameter {
    6666      get { return (FixedValueParameter<IntValue>)Parameters["MinimumTabuTenure"]; }
    6767    }
    68     private FixedValueParameter<IntValue> MaximumTabuTenureParameter {
     68    public FixedValueParameter<IntValue> MaximumTabuTenureParameter {
    6969      get { return (FixedValueParameter<IntValue>)Parameters["MaximumTabuTenure"]; }
    7070    }
    71     private FixedValueParameter<BoolValue> UseAlternativeAspirationParameter {
     71    public FixedValueParameter<BoolValue> UseAlternativeAspirationParameter {
    7272      get { return (FixedValueParameter<BoolValue>)Parameters["UseAlternativeAspiration"]; }
    7373    }
    74     private FixedValueParameter<IntValue> AlternativeAspirationTenureParameter {
     74    public FixedValueParameter<IntValue> AlternativeAspirationTenureParameter {
    7575      get { return (FixedValueParameter<IntValue>)Parameters["AlternativeAspirationTenure"]; }
    7676    }
    77     private FixedValueParameter<BoolValue> UseNewTabuTenureAdaptionSchemeParameter {
     77    public FixedValueParameter<BoolValue> UseNewTabuTenureAdaptionSchemeParameter {
    7878      get { return (FixedValueParameter<BoolValue>)Parameters["UseNewTabuTenureAdaptionScheme"]; }
    7979    }
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.cs

    r6875 r6936  
    2323using System.ComponentModel;
    2424using System.Drawing;
    25 using System.Linq;
    2625using System.Windows.Forms;
    2726using HeuristicLab.Common.Resources;
    28 using HeuristicLab.Core;
    2927using HeuristicLab.Core.Views;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Encodings.PermutationEncoding;
    3228using HeuristicLab.MainForm;
    3329using HeuristicLab.MainForm.WindowsForms;
     
    3834  [Content(typeof(QuadraticAssignmentProblem), IsDefaultView = true)]
    3935  public sealed partial class QuadraticAssignmentProblemView : ParameterizedNamedItemView {
     36    private QAPService qapService;
     37
    4038    public new QuadraticAssignmentProblem Content {
    4139      get { return (QuadraticAssignmentProblem)base.Content; }
     
    5250      parameterCollectionView.Dock = DockStyle.Fill;
    5351      problemTabPage.Controls.Add(parameterCollectionView);
     52      qapService = new QAPService();
    5453    }
    5554
     
    150149      if (String.IsNullOrEmpty(instance)) return;
    151150      using (var client = new QAPClient()) {
    152         loadInstanceWorker.ReportProgress(10);
    153         var data = client.GetProblemInstanceData(instance);
    154         loadInstanceWorker.ReportProgress(60);
    155         DoubleMatrix weights = new DoubleMatrix(data.Weights.Length, data.Weights.Length);
    156         DoubleMatrix distances = new DoubleMatrix(data.Weights.Length, data.Weights.Length);
    157         try {
    158           for (int i = 0; i < data.Weights.Length; i++)
    159             for (int j = 0; j < data.Weights.Length; j++) {
    160               weights[i, j] = data.Weights[i][j];
    161               distances[i, j] = data.Distances[i][j];
    162             }
    163         } catch (IndexOutOfRangeException) {
    164           MessageBox.Show("The problem data is malformed, the problem could not be loaded.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    165         }
    166         loadInstanceWorker.ReportProgress(65);
    167         Content.Name = data.Name;
    168         Content.Description = data.Description;
    169         Content.Maximization.Value = data.Maximization;
    170         Content.Weights = weights;
    171         Content.Distances = distances;
    172 
    173         Content.BestKnownQualityParameter.Value = null;
    174         Content.BestKnownSolution = null;
    175         Content.BestKnownSolutions = new ItemSet<Permutation>();
    176         var solutions = client.GetBestSolutionsData(instance);
    177         loadInstanceWorker.ReportProgress(90);
    178         if (solutions.Any()) {
    179           Content.BestKnownQualityParameter.Value = new DoubleValue(solutions.First().Quality);
    180           Content.BestKnownSolution = new Permutation(PermutationTypes.Absolute, solutions.First().Assignment);
    181           foreach (var solution in solutions) {
    182             Content.BestKnownSolutions.Add(new Permutation(PermutationTypes.Absolute, solution.Assignment));
    183           }
    184         }
    185         loadInstanceWorker.ReportProgress(100);
     151        qapService.Configure(Content, client, instance, (x) => { if (!Disposing && !IsDisposed) loadInstanceWorker.ReportProgress(x); });
    186152      }
    187153    }
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment/3.3/HeuristicLab.Problems.QuadraticAssignment-3.3.csproj

    r6878 r6936  
    140140      <DependentUpon>Reference.svcmap</DependentUpon>
    141141    </Compile>
     142    <Compile Include="Services\QAPService.cs" />
    142143    <None Include="app.config" />
    143144    <None Include="Plugin.cs.frame" />
     
    251252    </None>
    252253  </ItemGroup>
     254  <ItemGroup />
    253255  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    254256  <PropertyGroup>
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Service References/QAPInstanceService/QAP.wsdl

    r6875 r6936  
    1414  <wsdl:message name="IQAP_GetProblemInstances_OutputMessage">
    1515    <wsdl:part name="parameters" element="tns:GetProblemInstancesResponse" />
     16  </wsdl:message>
     17  <wsdl:message name="IQAP_GetProblemInstancesOfSize_InputMessage">
     18    <wsdl:part name="parameters" element="tns:GetProblemInstancesOfSize" />
     19  </wsdl:message>
     20  <wsdl:message name="IQAP_GetProblemInstancesOfSize_OutputMessage">
     21    <wsdl:part name="parameters" element="tns:GetProblemInstancesOfSizeResponse" />
    1622  </wsdl:message>
    1723  <wsdl:message name="IQAP_GetProblemInstanceData_InputMessage">
     
    3238      <wsdl:output wsaw:Action="http://tempuri.org/IQAP/GetProblemInstancesResponse" message="tns:IQAP_GetProblemInstances_OutputMessage" />
    3339    </wsdl:operation>
     40    <wsdl:operation name="GetProblemInstancesOfSize">
     41      <wsdl:input wsaw:Action="http://tempuri.org/IQAP/GetProblemInstancesOfSize" message="tns:IQAP_GetProblemInstancesOfSize_InputMessage" />
     42      <wsdl:output wsaw:Action="http://tempuri.org/IQAP/GetProblemInstancesOfSizeResponse" message="tns:IQAP_GetProblemInstancesOfSize_OutputMessage" />
     43    </wsdl:operation>
    3444    <wsdl:operation name="GetProblemInstanceData">
    3545      <wsdl:input wsaw:Action="http://tempuri.org/IQAP/GetProblemInstanceData" message="tns:IQAP_GetProblemInstanceData_InputMessage" />
     
    4555    <wsdl:operation name="GetProblemInstances">
    4656      <soap:operation soapAction="http://tempuri.org/IQAP/GetProblemInstances" style="document" />
     57      <wsdl:input>
     58        <soap:body use="literal" />
     59      </wsdl:input>
     60      <wsdl:output>
     61        <soap:body use="literal" />
     62      </wsdl:output>
     63    </wsdl:operation>
     64    <wsdl:operation name="GetProblemInstancesOfSize">
     65      <soap:operation soapAction="http://tempuri.org/IQAP/GetProblemInstancesOfSize" style="document" />
    4766      <wsdl:input>
    4867        <soap:body use="literal" />
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Service References/QAPInstanceService/QAP1.xsd

    r6875 r6936  
    1515    </xs:complexType>
    1616  </xs:element>
     17  <xs:element name="GetProblemInstancesOfSize">
     18    <xs:complexType>
     19      <xs:sequence>
     20        <xs:element minOccurs="0" name="minSize" type="xs:int" />
     21        <xs:element minOccurs="0" name="maxSize" type="xs:int" />
     22      </xs:sequence>
     23    </xs:complexType>
     24  </xs:element>
     25  <xs:element name="GetProblemInstancesOfSizeResponse">
     26    <xs:complexType>
     27      <xs:sequence>
     28        <xs:element xmlns:q2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="GetProblemInstancesOfSizeResult" nillable="true" type="q2:ArrayOfstring" />
     29      </xs:sequence>
     30    </xs:complexType>
     31  </xs:element>
    1732  <xs:element name="GetProblemInstanceData">
    1833    <xs:complexType>
     
    2540    <xs:complexType>
    2641      <xs:sequence>
    27         <xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.ProblemInstances" minOccurs="0" name="GetProblemInstanceDataResult" nillable="true" type="q2:QAPInstanceDto" />
     42        <xs:element xmlns:q3="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.ProblemInstances" minOccurs="0" name="GetProblemInstanceDataResult" nillable="true" type="q3:QAPInstanceDto" />
    2843      </xs:sequence>
    2944    </xs:complexType>
     
    3954    <xs:complexType>
    4055      <xs:sequence>
    41         <xs:element xmlns:q3="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.ProblemInstances" minOccurs="0" name="GetBestSolutionsDataResult" nillable="true" type="q3:ArrayOfQAPSolutionDto" />
     56        <xs:element xmlns:q4="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.ProblemInstances" minOccurs="0" name="GetBestSolutionsDataResult" nillable="true" type="q4:ArrayOfQAPSolutionDto" />
    4257      </xs:sequence>
    4358    </xs:complexType>
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Service References/QAPInstanceService/Reference.cs

    r6875 r6936  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.431
     4//     Runtime Version:4.0.30319.237
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    239239        string[] GetProblemInstances();
    240240       
     241        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IQAP/GetProblemInstancesOfSize", ReplyAction="http://tempuri.org/IQAP/GetProblemInstancesOfSizeResponse")]
     242        string[] GetProblemInstancesOfSize(int minSize, int maxSize);
     243       
    241244        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IQAP/GetProblemInstanceData", ReplyAction="http://tempuri.org/IQAP/GetProblemInstanceDataResponse")]
    242245        HeuristicLab.Problems.QuadraticAssignment.QAPInstanceService.QAPInstanceDto GetProblemInstanceData(string instance);
     
    277280        }
    278281       
     282        public string[] GetProblemInstancesOfSize(int minSize, int maxSize) {
     283            return base.Channel.GetProblemInstancesOfSize(minSize, maxSize);
     284        }
     285       
    279286        public HeuristicLab.Problems.QuadraticAssignment.QAPInstanceService.QAPInstanceDto GetProblemInstanceData(string instance) {
    280287            return base.Channel.GetProblemInstanceData(instance);
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Service References/QAPInstanceService/configuration.svcinfo

    r6875 r6936  
    33  <behaviors />
    44  <bindings>
    5     <binding digest="System.ServiceModel.Configuration.BasicHttpBindingElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data hostNameComparisonMode=&quot;StrongWildcard&quot; maxBufferSize=&quot;65536&quot; messageEncoding=&quot;Text&quot; name=&quot;BasicHttpBinding_IQAP&quot; textEncoding=&quot;utf-8&quot; transferMode=&quot;Buffered&quot;&gt;&lt;readerQuotas maxArrayLength=&quot;16384&quot; maxBytesPerRead=&quot;4096&quot; maxDepth=&quot;32&quot; maxNameTableCharCount=&quot;16384&quot; maxStringContentLength=&quot;8192&quot; /&gt;&lt;security mode=&quot;None&quot;&gt;&lt;message algorithmSuite=&quot;Default&quot; clientCredentialType=&quot;UserName&quot; /&gt;&lt;transport clientCredentialType=&quot;None&quot; proxyCredentialType=&quot;None&quot; realm=&quot;&quot; /&gt;&lt;/security&gt;&lt;/Data&gt;" bindingType="basicHttpBinding" name="BasicHttpBinding_IQAP" />
     5    <binding digest="System.ServiceModel.Configuration.BasicHttpBindingElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data hostNameComparisonMode=&quot;StrongWildcard&quot; maxBufferSize=&quot;65536&quot; messageEncoding=&quot;Text&quot; name=&quot;BasicHttpBinding_IQAP1&quot; textEncoding=&quot;utf-8&quot; transferMode=&quot;Buffered&quot;&gt;&lt;readerQuotas maxArrayLength=&quot;16384&quot; maxBytesPerRead=&quot;4096&quot; maxDepth=&quot;32&quot; maxNameTableCharCount=&quot;16384&quot; maxStringContentLength=&quot;8192&quot; /&gt;&lt;security mode=&quot;None&quot;&gt;&lt;message algorithmSuite=&quot;Default&quot; clientCredentialType=&quot;UserName&quot; /&gt;&lt;transport clientCredentialType=&quot;None&quot; proxyCredentialType=&quot;None&quot; realm=&quot;&quot; /&gt;&lt;/security&gt;&lt;/Data&gt;" bindingType="basicHttpBinding" name="BasicHttpBinding_IQAP1" />
    66  </bindings>
    77  <endpoints>
    8     <endpoint normalizedDigest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BasicHttpBinding_IQAP&quot; contract=&quot;QAPInstanceService.IQAP&quot; name=&quot;BasicHttpBinding_IQAP&quot; /&gt;" digest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BasicHttpBinding_IQAP&quot; contract=&quot;QAPInstanceService.IQAP&quot; name=&quot;BasicHttpBinding_IQAP&quot; /&gt;" contractName="QAPInstanceService.IQAP" name="BasicHttpBinding_IQAP" />
     8    <endpoint normalizedDigest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BasicHttpBinding_IQAP1&quot; contract=&quot;QAPInstanceService.IQAP&quot; name=&quot;BasicHttpBinding_IQAP1&quot; /&gt;" digest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BasicHttpBinding_IQAP1&quot; contract=&quot;QAPInstanceService.IQAP&quot; name=&quot;BasicHttpBinding_IQAP1&quot; /&gt;" contractName="QAPInstanceService.IQAP" name="BasicHttpBinding_IQAP1" />
    99  </endpoints>
    1010</configurationSnapshot>
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Service References/QAPInstanceService/configuration91.svcinfo

    r6875 r6936  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="QeiWFCVcLTWEHWNKCNg2gVsn4EY=">
     2<SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="skUfyVwhB3jeStxrxUEPaRKKcK8=">
    33  <bindingConfigurations>
    4     <bindingConfiguration bindingType="basicHttpBinding" name="BasicHttpBinding_IQAP">
     4    <bindingConfiguration bindingType="basicHttpBinding" name="BasicHttpBinding_IQAP1">
    55      <properties>
    66        <property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    7           <serializedValue>BasicHttpBinding_IQAP</serializedValue>
     7          <serializedValue>BasicHttpBinding_IQAP1</serializedValue>
    88        </property>
    99        <property path="/closeTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     
    113113  </bindingConfigurations>
    114114  <endpoints>
    115     <endpoint name="BasicHttpBinding_IQAP" contract="QAPInstanceService.IQAP" bindingType="basicHttpBinding" address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc" bindingConfiguration="BasicHttpBinding_IQAP">
     115    <endpoint name="BasicHttpBinding_IQAP1" contract="QAPInstanceService.IQAP" bindingType="basicHttpBinding" address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc" bindingConfiguration="BasicHttpBinding_IQAP1">
    116116      <properties>
    117117        <property path="/address" isComplexType="false" isExplicitlyDefined="true" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     
    125125        </property>
    126126        <property path="/bindingConfiguration" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    127           <serializedValue>BasicHttpBinding_IQAP</serializedValue>
     127          <serializedValue>BasicHttpBinding_IQAP1</serializedValue>
    128128        </property>
    129129        <property path="/contract" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     
    188188        </property>
    189189        <property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    190           <serializedValue>BasicHttpBinding_IQAP</serializedValue>
     190          <serializedValue>BasicHttpBinding_IQAP1</serializedValue>
    191191        </property>
    192192        <property path="/kind" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
Note: See TracChangeset for help on using the changeset viewer.