Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6733 for branches


Ignore:
Timestamp:
09/10/11 16:25:22 (13 years ago)
Author:
abeham
Message:

#1619

  • Updated the model slightly
  • Deployed the service
  • Updated the GUI to perform asynchronous calls to the service
Location:
branches/GeneralizedQAP
Files:
12 added
8 deleted
22 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab 3.3 Services.sln

    r6659 r6733  
    1818EndProject
    1919Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.ProblemInstances-3.3", "HeuristicLab.Services.ProblemInstances\HeuristicLab.Services.ProblemInstances-3.3.csproj", "{D4E9242F-DAA4-4A15-8DE7-91CECFFFD898}"
    20 EndProject
    21 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.ProblemInstances.QAPInitializer", "HeuristicLab.Services.ProblemInstances.QAPInitializer\HeuristicLab.Services.ProblemInstances.QAPInitializer.csproj", "{BA6B5487-6CCA-4484-B196-13B68A45CBB5}"
    22   ProjectSection(ProjectDependencies) = postProject
    23     {D4E9242F-DAA4-4A15-8DE7-91CECFFFD898} = {D4E9242F-DAA4-4A15-8DE7-91CECFFFD898}
    24   EndProjectSection
    2520EndProject
    2621Global
     
    9994    {D4E9242F-DAA4-4A15-8DE7-91CECFFFD898}.Release|x64.ActiveCfg = Release|Any CPU
    10095    {D4E9242F-DAA4-4A15-8DE7-91CECFFFD898}.Release|x86.ActiveCfg = Release|Any CPU
    101     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|Any CPU.ActiveCfg = Debug|x86
    102     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
    103     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|Mixed Platforms.Build.0 = Debug|x86
    104     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|x64.ActiveCfg = Debug|x86
    105     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|x86.ActiveCfg = Debug|x86
    106     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|x86.Build.0 = Debug|x86
    107     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|Any CPU.ActiveCfg = Release|x86
    108     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|Mixed Platforms.ActiveCfg = Release|x86
    109     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|Mixed Platforms.Build.0 = Release|x86
    110     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|x64.ActiveCfg = Release|x86
    111     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|x86.ActiveCfg = Release|x86
    112     {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|x86.Build.0 = Release|x86
    11396  EndGlobalSection
    11497  GlobalSection(SolutionProperties) = preSolution
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/HeuristicLab.Problems.QuadraticAssignment.Views-3.3.csproj

    r6659 r6733  
    154154      <DependentUpon>Reference.svcmap</DependentUpon>
    155155    </None>
    156     <None Include="Service References\QAPServiceReference\QAP.wsdl" />
    157     <None Include="Service References\QAPServiceReference\QAP.xsd">
    158       <SubType>Designer</SubType>
    159     </None>
    160     <None Include="Service References\QAPServiceReference\QAP1.xsd">
    161       <SubType>Designer</SubType>
    162     </None>
    163     <None Include="Service References\QAPServiceReference\QAP2.xsd">
    164       <SubType>Designer</SubType>
    165     </None>
    166     <None Include="Service References\QAPServiceReference\QAP3.xsd">
    167       <SubType>Designer</SubType>
    168     </None>
    169156  </ItemGroup>
    170157  <ItemGroup>
     
    232219  </ItemGroup>
    233220  <ItemGroup>
    234     <None Include="Service References\QAPServiceReference\QAP.disco" />
    235   </ItemGroup>
    236   <ItemGroup>
    237221    <None Include="Service References\QAPServiceReference\configuration91.svcinfo" />
    238222  </ItemGroup>
     
    241225  </ItemGroup>
    242226  <ItemGroup>
     227    <None Include="Service References\QAPServiceReference\QAP1.wsdl" />
     228    <None Include="Service References\QAPServiceReference\QAP4.xsd">
     229      <SubType>Designer</SubType>
     230    </None>
     231    <None Include="Service References\QAPServiceReference\QAP41.xsd">
     232      <SubType>Designer</SubType>
     233    </None>
     234    <None Include="Service References\QAPServiceReference\QAP42.xsd">
     235      <SubType>Designer</SubType>
     236    </None>
     237    <None Include="Service References\QAPServiceReference\QAP43.xsd">
     238      <SubType>Designer</SubType>
     239    </None>
    243240    <None Include="Service References\QAPServiceReference\Reference.svcmap">
    244241      <Generator>WCF Proxy Generator</Generator>
    245242      <LastGenOutput>Reference.cs</LastGenOutput>
    246243    </None>
     244  </ItemGroup>
     245  <ItemGroup>
     246    <None Include="Service References\QAPServiceReference\QAP1.disco" />
    247247  </ItemGroup>
    248248  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.cs

    r6660 r6733  
    2323using System.Drawing;
    2424using System.Linq;
     25using System.Threading.Tasks;
    2526using System.Windows.Forms;
    2627using HeuristicLab.Common.Resources;
     
    8081    protected override void OnContentChanged() {
    8182      base.OnContentChanged();
    82       instancesComboBox.Items.Clear();
    8383      if (Content != null) {
    84         foreach (string instance in Content.EmbeddedInstances) {
    85           instancesComboBox.Items.Add(instance);
    86         }
    8784        qapView.Distances = Content.Distances;
    8885        qapView.Weights = Content.Weights;
     
    9794    protected override void SetEnabledStateOfControls() {
    9895      base.SetEnabledStateOfControls();
     96      reloadInstancesButton.Enabled = !ReadOnly && !Locked && Content != null;
    9997      instancesComboBox.Enabled = !ReadOnly && !Locked && Content != null;
    100       loadInstanceButton.Enabled = !ReadOnly && !Locked && Content != null && instancesComboBox.SelectedItem != null;
     98      loadInstanceButton.Enabled = !ReadOnly && !Locked && Content != null && !String.IsNullOrEmpty((string)instancesComboBox.SelectedItem);
    10199      importInstanceButton.Enabled = !ReadOnly && !Locked && Content != null;
    102100    }
    103101
    104102    private void instancesComboBox_SelectedValueChanged(object sender, System.EventArgs e) {
    105       loadInstanceButton.Enabled = instancesComboBox.SelectedItem != null;
     103      SetEnabledStateOfControls();
    106104    }
    107105
    108106    private void loadInstanceButton_Click(object sender, System.EventArgs e) {
    109       string instance = instancesComboBox.SelectedItem as string;
    110       try {
    111         using (QAPServiceReference.QAPClient client = new QAPServiceReference.QAPClient()) {
    112           var data = client.GetProblemInstanceData(instance);
    113           DoubleMatrix weights = new DoubleMatrix(data.Weights.Length, data.Weights.Length);
    114           DoubleMatrix distances = new DoubleMatrix(data.Weights.Length, data.Weights.Length);
    115           try {
    116             for (int i = 0; i < data.Weights.Length; i++)
    117               for (int j = 0; j < data.Weights.Length; j++) {
    118                 weights[i, j] = data.Weights[i][j];
    119                 distances[i, j] = data.Distances[i][j];
     107      ReadOnly = true;
     108      string instanceStr = instancesComboBox.SelectedItem as string;
     109      Task t = new Task((object name) => {
     110        string instance = (string)name;
     111        if (String.IsNullOrEmpty(instance)) return;
     112        try {
     113          using (QAPServiceReference.QAPClient client = new QAPServiceReference.QAPClient()) {
     114            var data = client.GetProblemInstanceData(instance);
     115            DoubleMatrix weights = new DoubleMatrix(data.Weights.Length, data.Weights.Length);
     116            DoubleMatrix distances = new DoubleMatrix(data.Weights.Length, data.Weights.Length);
     117            try {
     118              for (int i = 0; i < data.Weights.Length; i++)
     119                for (int j = 0; j < data.Weights.Length; j++) {
     120                  weights[i, j] = data.Weights[i][j];
     121                  distances[i, j] = data.Distances[i][j];
     122                }
     123            } catch (IndexOutOfRangeException) {
     124              MessageBox.Show("The problem data is malformed, the problem could not be loaded.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     125            }
     126            Content.Name = data.Name;
     127            Content.Description = data.Description;
     128            Content.Maximization.Value = data.Maximization;
     129            Content.Weights = weights;
     130            Content.Distances = distances;
     131
     132            Content.BestKnownQualityParameter.Value = null;
     133            Content.BestKnownSolution = null;
     134            Content.BestKnownSolutions = new ItemSet<Permutation>();
     135            var solutions = client.GetBestSolutionsData(instance);
     136            if (solutions.Any()) {
     137              Content.BestKnownQualityParameter.Value = new DoubleValue(solutions.First().Quality);
     138              Content.BestKnownSolution = new Permutation(PermutationTypes.Absolute, solutions.First().Assignment);
     139              foreach (var solution in solutions) {
     140                Content.BestKnownSolutions.Add(new Permutation(PermutationTypes.Absolute, solution.Assignment));
    120141              }
    121           } catch (IndexOutOfRangeException) {
    122             MessageBox.Show("The problem data is malformed, the problem could not be loaded.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    123           }
    124           Content.Name = data.Name;
    125           Content.Description = data.Description;
    126           Content.Maximization.Value = data.Maximization;
    127           Content.Weights = weights;
    128           Content.Distances = distances;
    129 
    130           Content.BestKnownQualityParameter.Value = null;
    131           Content.BestKnownSolution = null;
    132           Content.BestKnownSolutions = new ItemSet<Permutation>();
    133           var solutions = client.GetBestSolutionsData(instance);
    134           if (solutions.Any()) {
    135             Content.BestKnownQualityParameter.Value = new DoubleValue(solutions.First().Quality);
    136             Content.BestKnownSolution = new Permutation(PermutationTypes.Absolute, solutions.First().Assignment);
    137             foreach (var solution in solutions) {
    138               Content.BestKnownSolutions.Add(new Permutation(PermutationTypes.Absolute, solution.Assignment));
    139142            }
    140143          }
     144        } catch (Exception ex) {
     145          PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);
     146        } finally {
     147          ReadOnly = false;
    141148        }
    142       } catch (Exception ex) {
    143         PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);
    144       }
     149      }, instanceStr);
     150      t.Start();
    145151    }
    146152
     
    172178
    173179    private void reloadInstancesButton_Click(object sender, EventArgs e) {
    174       try {
    175         using (QAPServiceReference.QAPClient client = new QAPServiceReference.QAPClient()) {
    176           instancesComboBox.Items.Clear();
    177           foreach (string name in client.GetProblemInstances())
    178             instancesComboBox.Items.Add(name);
     180      ReadOnly = true;
     181      System.Threading.Tasks.Task t = new System.Threading.Tasks.Task(() => {
     182        try {
     183          using (QAPServiceReference.QAPClient client = new QAPServiceReference.QAPClient()) {
     184            instancesComboBox.Items.Clear();
     185            foreach (string name in client.GetProblemInstances())
     186              instancesComboBox.Items.Add(name);
     187            if (instancesComboBox.Items.Count > 0)
     188              instancesComboBox.SelectedIndex = 0;
     189          }
     190        } catch (Exception ex) {
     191          PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);
     192        } finally {
     193          ReadOnly = false;
    179194        }
    180       } catch (Exception ex) {
    181         PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);
    182       }
     195      });
     196      t.Start();
    183197    }
    184198  }
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPInstanceDto.datasource

    r6659 r6733  
    77-->
    88<GenericObjectDataSource DisplayName="QAPInstanceDto" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
    9    <TypeInfo>HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPInstanceDto</TypeInfo>
     9   <TypeInfo>HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPInstanceDto, Service References.QAPServiceReference.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
    1010</GenericObjectDataSource>
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPSolutionDto.datasource

    r6659 r6733  
    77-->
    88<GenericObjectDataSource DisplayName="QAPSolutionDto" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
    9    <TypeInfo>HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPSolutionDto</TypeInfo>
     9   <TypeInfo>HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPSolutionDto, Service References.QAPServiceReference.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
    1010</GenericObjectDataSource>
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/Reference.cs

    r6659 r6733  
    2424       
    2525        [System.Runtime.Serialization.OptionalFieldAttribute()]
     26        private double BestKnownQualityField;
     27       
     28        [System.Runtime.Serialization.OptionalFieldAttribute()]
    2629        private string DescriptionField;
    2730       
    2831        [System.Runtime.Serialization.OptionalFieldAttribute()]
    2932        private double[][] DistancesField;
     33       
     34        [System.Runtime.Serialization.OptionalFieldAttribute()]
     35        private bool HasBestKnownQualityField;
    3036       
    3137        [System.Runtime.Serialization.OptionalFieldAttribute()]
     
    4551            set {
    4652                this.extensionDataField = value;
     53            }
     54        }
     55       
     56        [System.Runtime.Serialization.DataMemberAttribute()]
     57        public double BestKnownQuality {
     58            get {
     59                return this.BestKnownQualityField;
     60            }
     61            set {
     62                if ((this.BestKnownQualityField.Equals(value) != true)) {
     63                    this.BestKnownQualityField = value;
     64                    this.RaisePropertyChanged("BestKnownQuality");
     65                }
    4766            }
    4867        }
     
    7089                    this.DistancesField = value;
    7190                    this.RaisePropertyChanged("Distances");
     91                }
     92            }
     93        }
     94       
     95        [System.Runtime.Serialization.DataMemberAttribute()]
     96        public bool HasBestKnownQuality {
     97            get {
     98                return this.HasBestKnownQualityField;
     99            }
     100            set {
     101                if ((this.HasBestKnownQualityField.Equals(value) != true)) {
     102                    this.HasBestKnownQualityField = value;
     103                    this.RaisePropertyChanged("HasBestKnownQuality");
    72104                }
    73105            }
     
    136168       
    137169        [System.Runtime.Serialization.OptionalFieldAttribute()]
     170        private bool AssignmentUndefinedField;
     171       
     172        [System.Runtime.Serialization.OptionalFieldAttribute()]
    138173        private double QualityField;
    139174       
     
    157192                    this.AssignmentField = value;
    158193                    this.RaisePropertyChanged("Assignment");
     194                }
     195            }
     196        }
     197       
     198        [System.Runtime.Serialization.DataMemberAttribute()]
     199        public bool AssignmentUndefined {
     200            get {
     201                return this.AssignmentUndefinedField;
     202            }
     203            set {
     204                if ((this.AssignmentUndefinedField.Equals(value) != true)) {
     205                    this.AssignmentUndefinedField = value;
     206                    this.RaisePropertyChanged("AssignmentUndefined");
    159207                }
    160208            }
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/Reference.svcmap

    r6659 r6733  
    1919  </ClientOptions>
    2020  <MetadataSources>
    21     <MetadataSource Address="http://localhost:3978/QAP/QAP.svc" Protocol="http" SourceId="1" />
     21    <MetadataSource Address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc" Protocol="http" SourceId="1" />
    2222  </MetadataSources>
    2323  <Metadata>
    24     <MetadataFile FileName="QAP.disco" MetadataType="Disco" ID="dea2bc2c-960b-40b9-94ce-8cffa4b02221" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?disco" />
    25     <MetadataFile FileName="QAP.wsdl" MetadataType="Wsdl" ID="ee1aab36-1ae6-4864-99de-d577d1f3de16" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?wsdl" />
    26     <MetadataFile FileName="QAP.xsd" MetadataType="Schema" ID="bf8e27bf-7807-41e0-8fe5-0941e9c0b93a" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?xsd=xsd2" />
    27     <MetadataFile FileName="QAP1.xsd" MetadataType="Schema" ID="4dc00ff5-082c-49a3-b956-0af89ccfc448" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?xsd=xsd3" />
    28     <MetadataFile FileName="QAP2.xsd" MetadataType="Schema" ID="d883e2c7-abf6-4c20-8d60-23f417b40561" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?xsd=xsd0" />
    29     <MetadataFile FileName="QAP3.xsd" MetadataType="Schema" ID="c86fad99-c0cb-4ce6-9318-38797ba97040" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?xsd=xsd1" />
     24    <MetadataFile FileName="QAP1.disco" MetadataType="Disco" ID="b15b4f39-21ff-4118-8aff-d2a421e1d163" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?disco" />
     25    <MetadataFile FileName="QAP1.wsdl" MetadataType="Wsdl" ID="d88dc4ea-2680-476d-8346-80a59c48b187" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?wsdl" />
     26    <MetadataFile FileName="QAP4.xsd" MetadataType="Schema" ID="6aad67b2-97c7-4a32-9cfd-8475ebf3060c" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?xsd=xsd3" />
     27    <MetadataFile FileName="QAP41.xsd" MetadataType="Schema" ID="457c09d3-5cf2-410c-beab-4c8187c62d98" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?xsd=xsd0" />
     28    <MetadataFile FileName="QAP42.xsd" MetadataType="Schema" ID="51f1963a-e89f-4e57-8253-252e9d21feca" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?xsd=xsd2" />
     29    <MetadataFile FileName="QAP43.xsd" MetadataType="Schema" ID="6adc07a9-4704-4ad0-b2cd-f304b65ee30d" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?xsd=xsd1" />
    3030  </Metadata>
    3131  <Extensions>
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/configuration.svcinfo

    r6659 r6733  
    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://localhost:3978/QAP/QAP.svc&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BasicHttpBinding_IQAP&quot; contract=&quot;QAPServiceReference.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://localhost:3978/QAP/QAP.svc&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BasicHttpBinding_IQAP&quot; contract=&quot;QAPServiceReference.IQAP&quot; name=&quot;BasicHttpBinding_IQAP&quot; /&gt;" contractName="QAPServiceReference.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_IQAP&quot; contract=&quot;QAPServiceReference.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;QAPServiceReference.IQAP&quot; name=&quot;BasicHttpBinding_IQAP&quot; /&gt;" contractName="QAPServiceReference.IQAP" name="BasicHttpBinding_IQAP" />
    99  </endpoints>
    1010</configurationSnapshot>
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/configuration91.svcinfo

    r6659 r6733  
    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="PGSA1ejV32Fh0z8GmGBf7NFeB0w=">
     2<SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="Ik4GzQEYPImjtoibudTmBx1Uums=">
    33  <bindingConfigurations>
    44    <bindingConfiguration bindingType="basicHttpBinding" name="BasicHttpBinding_IQAP">
     
    113113  </bindingConfigurations>
    114114  <endpoints>
    115     <endpoint name="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP" bindingType="basicHttpBinding" address="http://localhost:3978/QAP/QAP.svc" bindingConfiguration="BasicHttpBinding_IQAP">
     115    <endpoint name="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP" bindingType="basicHttpBinding" address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc" bindingConfiguration="BasicHttpBinding_IQAP">
    116116      <properties>
    117117        <property path="/address" isComplexType="false" isExplicitlyDefined="true" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    118           <serializedValue>http://localhost:3978/QAP/QAP.svc</serializedValue>
     118          <serializedValue>http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc</serializedValue>
    119119        </property>
    120120        <property path="/behaviorConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/app.config

    r6659 r6733  
    22<configuration>
    33    <system.serviceModel>
     4      <behaviors>
     5        <endpointBehaviors>
     6          <behavior name="ProblemInstancesLargeMessages">
     7            <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
     8          </behavior>
     9        </endpointBehaviors>
     10      </behaviors>
    411        <bindings>
    512            <basicHttpBinding>
     
    714                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    815                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
    9                     maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
     16                    maxBufferSize="16777216" maxBufferPoolSize="524288" maxReceivedMessageSize="16777216"
    1017                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
    1118                    useDefaultWebProxy="true">
    12                     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    13                         maxBytesPerRead="4096" maxNameTableCharCount="16384" />
     19                    <readerQuotas maxDepth="512" maxStringContentLength="1048576" maxArrayLength="1048576"
     20                        maxBytesPerRead="8192" maxNameTableCharCount="16384" />
    1421                    <security mode="None">
    1522                        <transport clientCredentialType="None" proxyCredentialType="None"
     
    2128        </bindings>
    2229        <client>
    23             <endpoint address="http://localhost:3978/QAP/QAP.svc" binding="basicHttpBinding"
    24                 bindingConfiguration="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP"
    25                 name="BasicHttpBinding_IQAP" />
     30            <endpoint address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc"
     31                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IQAP"
     32                behaviorConfiguration="ProblemInstancesLargeMessages"
     33                contract="QAPServiceReference.IQAP" name="BasicHttpBinding_IQAP" />
    2634        </client>
    2735    </system.serviceModel>
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment/3.3/HeuristicLab.Problems.QuadraticAssignment-3.3.csproj

    r6685 r6733  
    233233    <EmbeddedResource Include="Data\tai100a.dat" />
    234234    <EmbeddedResource Include="Data\tai100b.dat" />
    235     <EmbeddedResource Include="Data\tai10a.dat" />
    236     <EmbeddedResource Include="Data\tai10b.dat" />
    237235    <EmbeddedResource Include="Data\tai12a.dat" />
    238236    <EmbeddedResource Include="Data\tai12b.dat" />
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances.QAPInitializer/Program.cs

    r6659 r6733  
    11using System;
     2using System.Linq;
    23using System.Text;
    34using HeuristicLab.Problems.QuadraticAssignment;
     
    1011        foreach (string instance in qap.EmbeddedInstances) {
    1112          qap.LoadEmbeddedInstance(instance);
    12           // transform matrices into jagged arrays
    13           double[][] weights = new double[qap.Weights.Rows][];
    14           double[][] distances = new double[qap.Weights.Rows][];
    15           for (int i = 0; i < weights.Length; i++) {
    16             weights[i] = new double[weights.Length];
    17             distances[i] = new double[weights.Length];
    18             for (int j = 0; j < weights.Length; j++) {
    19               weights[i][j] = qap.Weights[i, j];
    20               distances[i][j] = qap.Distances[i, j];
     13          // transform DoubleMatrix into multidimensional array
     14          double[,] weights = new double[qap.Weights.Rows, qap.Weights.Columns];
     15          double[,] distances = new double[qap.Distances.Rows, qap.Distances.Columns];
     16          for (int i = 0; i < weights.GetLength(0); i++) {
     17            for (int j = 0; j < weights.GetLength(1); j++) {
     18              weights[i, j] = qap.Weights[i, j];
     19              distances[i, j] = qap.Distances[i, j];
    2120            }
    2221          }
    2322
    2423          QAPInstance dbInstance = context.CreateObject<QAPInstance>();
    25           dbInstance.name = qap.Name;
    26           dbInstance.description = qap.Description;
    27           dbInstance.maximization = qap.Maximization.Value;
    28           dbInstance.weights = PrimitiveSerializer.SerializeDoubleMatrix(weights);
    29           dbInstance.weights_sha1 = GetSHA1Hash(dbInstance.weights);
    30           dbInstance.distances = PrimitiveSerializer.SerializeDoubleMatrix(distances);
    31           dbInstance.distances_sha1 = GetSHA1Hash(dbInstance.distances);
    32           dbInstance.problemsize = qap.Weights.Rows;
     24          dbInstance.Name = qap.Name;
     25          dbInstance.Description = qap.Description;
     26          dbInstance.Maximization = qap.Maximization.Value;
     27          dbInstance.Weights = SimpleSerializer.SerializeDoubleMatrix(weights);
     28          dbInstance.WeightsHash = GetSHA1Hash(dbInstance.Weights);
     29          dbInstance.Distances = SimpleSerializer.SerializeDoubleMatrix(distances);
     30          dbInstance.DistancesHash = GetSHA1Hash(dbInstance.Distances);
     31          dbInstance.ProblemSize = qap.Weights.Rows;
     32          context.QAPInstances.AddObject(dbInstance);
    3333
    34           context.QAPInstances.AddObject(dbInstance);
     34          if (qap.BestKnownQuality != null) {
     35            QAPSolution dbSolution = context.CreateObject<QAPSolution>();
     36            if (qap.BestKnownSolution != null) {
     37              dbSolution.Assignment = SimpleSerializer.SerializeIntArray(qap.BestKnownSolution.ToArray());
     38              dbSolution.AssignmentHash = GetSHA1Hash(dbSolution.Assignment);
     39            }
     40            dbSolution.Instance = dbInstance;
     41            dbSolution.Quality = qap.BestKnownQuality.Value;
     42            context.QAPSolutions.AddObject(dbSolution);
     43          }
    3544        }
    3645        context.SaveChanges();
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances.QAPInitializer/app.config

    r6659 r6733  
    66    </system.serviceModel>
    77  <connectionStrings>
    8     <add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=MRPINK\SQLEXPRESS;Initial Catalog=ProblemInstances;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
     8    <add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=MRPINK\SQLEXPRESS;Initial Catalog=HeuristicLab.ProblemInstances;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    99  </connectionStrings>
    1010</configuration>
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/HeuristicLab.Services.ProblemInstances-3.3.csproj

    r6659 r6733  
    2323    <ErrorReport>prompt</ErrorReport>
    2424    <WarningLevel>4</WarningLevel>
     25    <PublishDatabaseSettings>
     26      <Objects>
     27        <ObjectGroup Name="ProblemInstancesEntities-Deployment" Order="1">
     28          <Destination Path="" />
     29          <Object Type="dbFullSql">
     30            <PreSource Path="Data Source=LOCALHOST\SQLEXPRESS%3bInitial Catalog=HeuristicLab.ProblemInstances%3bIntegrated Security=True%3bPooling=False" ScriptSchema="True" ScriptData="False" CopyAllFullTextCatalogs="False" />
     31            <Source Path="obj\Debug\AutoScripts\ProblemInstancesEntities-Deployment_SchemaOnly.sql" Transacted="True" />
     32          </Object>
     33        </ObjectGroup>
     34      </Objects>
     35    </PublishDatabaseSettings>
     36    <ExcludeGeneratedDebugSymbol>false</ExcludeGeneratedDebugSymbol>
    2537  </PropertyGroup>
    2638  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    3143    <ErrorReport>prompt</ErrorReport>
    3244    <WarningLevel>4</WarningLevel>
     45    <PublishDatabaseSettings>
     46      <Objects>
     47      </Objects>
     48    </PublishDatabaseSettings>
     49    <ExcludeGeneratedDebugSymbol>true</ExcludeGeneratedDebugSymbol>
     50  </PropertyGroup>
     51  <PropertyGroup>
     52    <SignAssembly>true</SignAssembly>
     53  </PropertyGroup>
     54  <PropertyGroup>
     55    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
    3356  </PropertyGroup>
    3457  <ItemGroup>
     
    5578  </ItemGroup>
    5679  <ItemGroup>
     80    <None Include="QAP\Initial.sql" />
    5781    <Content Include="QAP\QAP.svc" />
    58     <Content Include="Web.config" />
     82    <Content Include="Web.config">
     83      <SubType>Designer</SubType>
     84    </Content>
    5985    <Content Include="Web.Debug.config">
    6086      <DependentUpon>Web.config</DependentUpon>
     
    6995      <LastGenOutput>ProblemInstancesModel.Designer.cs</LastGenOutput>
    7096    </EntityDeploy>
     97    <None Include="HeuristicLab.snk" />
    7198    <None Include="Properties\AssemblyInfo.frame" />
    72     <Compile Include="PrimitiveSerializationException.cs" />
    73     <Compile Include="PrimitiveSerializer.cs" />
     99    <Compile Include="Auxiliary.cs" />
     100    <Compile Include="SimpleSerializationException.cs" />
     101    <Compile Include="SimpleSerializer.cs" />
    74102    <Compile Include="ProblemInstancesModel.Designer.cs">
    75103      <AutoGen>True</AutoGen>
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/ProblemInstancesModel.Designer.cs

    r6659 r6733  
    1919#region EDM Relationship Metadata
    2020
    21 [assembly: EdmRelationshipAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance", "QAPInstance", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(HeuristicLab.Services.ProblemInstances.QAPInstance), "QAPSolution", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(HeuristicLab.Services.ProblemInstances.QAPSolution), true)]
     21[assembly: EdmRelationshipAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance1", "QAPInstance", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(HeuristicLab.Services.ProblemInstances.QAPInstance), "QAPSolution", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(HeuristicLab.Services.ProblemInstances.QAPSolution), true)]
    2222
    2323#endregion
     
    143143        /// Create a new QAPInstance object.
    144144        /// </summary>
    145         /// <param name="name">Initial value of the name property.</param>
    146         /// <param name="maximization">Initial value of the maximization property.</param>
    147         /// <param name="weights">Initial value of the weights property.</param>
    148         /// <param name="weights_sha1">Initial value of the weights_sha1 property.</param>
    149         /// <param name="distances">Initial value of the distances property.</param>
    150         /// <param name="distances_sha1">Initial value of the distances_sha1 property.</param>
    151         /// <param name="problemsize">Initial value of the problemsize property.</param>
    152         public static QAPInstance CreateQAPInstance(global::System.String name, global::System.Boolean maximization, global::System.String weights, global::System.String weights_sha1, global::System.String distances, global::System.String distances_sha1, global::System.Int32 problemsize)
     145        /// <param name="name">Initial value of the Name property.</param>
     146        /// <param name="maximization">Initial value of the Maximization property.</param>
     147        /// <param name="weights">Initial value of the Weights property.</param>
     148        /// <param name="weightsHash">Initial value of the WeightsHash property.</param>
     149        /// <param name="distances">Initial value of the Distances property.</param>
     150        /// <param name="distancesHash">Initial value of the DistancesHash property.</param>
     151        /// <param name="problemSize">Initial value of the ProblemSize property.</param>
     152        public static QAPInstance CreateQAPInstance(global::System.String name, global::System.Boolean maximization, global::System.String weights, global::System.String weightsHash, global::System.String distances, global::System.String distancesHash, global::System.Int32 problemSize)
    153153        {
    154154            QAPInstance qAPInstance = new QAPInstance();
    155             qAPInstance.name = name;
    156             qAPInstance.maximization = maximization;
    157             qAPInstance.weights = weights;
    158             qAPInstance.weights_sha1 = weights_sha1;
    159             qAPInstance.distances = distances;
    160             qAPInstance.distances_sha1 = distances_sha1;
    161             qAPInstance.problemsize = problemsize;
     155            qAPInstance.Name = name;
     156            qAPInstance.Maximization = maximization;
     157            qAPInstance.Weights = weights;
     158            qAPInstance.WeightsHash = weightsHash;
     159            qAPInstance.Distances = distances;
     160            qAPInstance.DistancesHash = distancesHash;
     161            qAPInstance.ProblemSize = problemSize;
    162162            return qAPInstance;
    163163        }
     
    171171        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
    172172        [DataMemberAttribute()]
    173         public global::System.String name
    174         {
    175             get
    176             {
    177                 return _name;
    178             }
    179             set
    180             {
    181                 if (_name != value)
     173        public global::System.String Name
     174        {
     175            get
     176            {
     177                return _Name;
     178            }
     179            set
     180            {
     181                if (_Name != value)
    182182                {
    183                     OnnameChanging(value);
    184                     ReportPropertyChanging("name");
    185                     _name = StructuralObject.SetValidValue(value, false);
    186                     ReportPropertyChanged("name");
    187                     OnnameChanged();
     183                    OnNameChanging(value);
     184                    ReportPropertyChanging("Name");
     185                    _Name = StructuralObject.SetValidValue(value, false);
     186                    ReportPropertyChanged("Name");
     187                    OnNameChanged();
    188188                }
    189189            }
    190190        }
    191         private global::System.String _name;
    192         partial void OnnameChanging(global::System.String value);
    193         partial void OnnameChanged();
     191        private global::System.String _Name;
     192        partial void OnNameChanging(global::System.String value);
     193        partial void OnNameChanged();
    194194   
    195195        /// <summary>
     
    198198        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
    199199        [DataMemberAttribute()]
    200         public global::System.String description
    201         {
    202             get
    203             {
    204                 return _description;
    205             }
    206             set
    207             {
    208                 OndescriptionChanging(value);
    209                 ReportPropertyChanging("description");
    210                 _description = StructuralObject.SetValidValue(value, true);
    211                 ReportPropertyChanged("description");
    212                 OndescriptionChanged();
    213             }
    214         }
    215         private global::System.String _description;
    216         partial void OndescriptionChanging(global::System.String value);
    217         partial void OndescriptionChanged();
    218    
    219         /// <summary>
    220         /// No Metadata Documentation available.
    221         /// </summary>
    222         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    223         [DataMemberAttribute()]
    224         public global::System.Boolean maximization
    225         {
    226             get
    227             {
    228                 return _maximization;
    229             }
    230             set
    231             {
    232                 OnmaximizationChanging(value);
    233                 ReportPropertyChanging("maximization");
    234                 _maximization = StructuralObject.SetValidValue(value);
    235                 ReportPropertyChanged("maximization");
    236                 OnmaximizationChanged();
    237             }
    238         }
    239         private global::System.Boolean _maximization;
    240         partial void OnmaximizationChanging(global::System.Boolean value);
    241         partial void OnmaximizationChanged();
    242    
    243         /// <summary>
    244         /// No Metadata Documentation available.
    245         /// </summary>
    246         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    247         [DataMemberAttribute()]
    248         public global::System.String weights
    249         {
    250             get
    251             {
    252                 return _weights;
    253             }
    254             set
    255             {
    256                 OnweightsChanging(value);
    257                 ReportPropertyChanging("weights");
    258                 _weights = StructuralObject.SetValidValue(value, false);
    259                 ReportPropertyChanged("weights");
    260                 OnweightsChanged();
    261             }
    262         }
    263         private global::System.String _weights;
    264         partial void OnweightsChanging(global::System.String value);
    265         partial void OnweightsChanged();
    266    
    267         /// <summary>
    268         /// No Metadata Documentation available.
    269         /// </summary>
    270         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    271         [DataMemberAttribute()]
    272         public global::System.String weights_sha1
    273         {
    274             get
    275             {
    276                 return _weights_sha1;
    277             }
    278             set
    279             {
    280                 Onweights_sha1Changing(value);
    281                 ReportPropertyChanging("weights_sha1");
    282                 _weights_sha1 = StructuralObject.SetValidValue(value, false);
    283                 ReportPropertyChanged("weights_sha1");
    284                 Onweights_sha1Changed();
    285             }
    286         }
    287         private global::System.String _weights_sha1;
    288         partial void Onweights_sha1Changing(global::System.String value);
    289         partial void Onweights_sha1Changed();
    290    
    291         /// <summary>
    292         /// No Metadata Documentation available.
    293         /// </summary>
    294         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    295         [DataMemberAttribute()]
    296         public global::System.String distances
    297         {
    298             get
    299             {
    300                 return _distances;
    301             }
    302             set
    303             {
    304                 OndistancesChanging(value);
    305                 ReportPropertyChanging("distances");
    306                 _distances = StructuralObject.SetValidValue(value, false);
    307                 ReportPropertyChanged("distances");
    308                 OndistancesChanged();
    309             }
    310         }
    311         private global::System.String _distances;
    312         partial void OndistancesChanging(global::System.String value);
    313         partial void OndistancesChanged();
    314    
    315         /// <summary>
    316         /// No Metadata Documentation available.
    317         /// </summary>
    318         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    319         [DataMemberAttribute()]
    320         public global::System.String distances_sha1
    321         {
    322             get
    323             {
    324                 return _distances_sha1;
    325             }
    326             set
    327             {
    328                 Ondistances_sha1Changing(value);
    329                 ReportPropertyChanging("distances_sha1");
    330                 _distances_sha1 = StructuralObject.SetValidValue(value, false);
    331                 ReportPropertyChanged("distances_sha1");
    332                 Ondistances_sha1Changed();
    333             }
    334         }
    335         private global::System.String _distances_sha1;
    336         partial void Ondistances_sha1Changing(global::System.String value);
    337         partial void Ondistances_sha1Changed();
    338    
    339         /// <summary>
    340         /// No Metadata Documentation available.
    341         /// </summary>
    342         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    343         [DataMemberAttribute()]
    344         public global::System.Int32 problemsize
    345         {
    346             get
    347             {
    348                 return _problemsize;
    349             }
    350             set
    351             {
    352                 OnproblemsizeChanging(value);
    353                 ReportPropertyChanging("problemsize");
    354                 _problemsize = StructuralObject.SetValidValue(value);
    355                 ReportPropertyChanged("problemsize");
    356                 OnproblemsizeChanged();
    357             }
    358         }
    359         private global::System.Int32 _problemsize;
    360         partial void OnproblemsizeChanging(global::System.Int32 value);
    361         partial void OnproblemsizeChanged();
     200        public global::System.String Description
     201        {
     202            get
     203            {
     204                return _Description;
     205            }
     206            set
     207            {
     208                OnDescriptionChanging(value);
     209                ReportPropertyChanging("Description");
     210                _Description = StructuralObject.SetValidValue(value, true);
     211                ReportPropertyChanged("Description");
     212                OnDescriptionChanged();
     213            }
     214        }
     215        private global::System.String _Description;
     216        partial void OnDescriptionChanging(global::System.String value);
     217        partial void OnDescriptionChanged();
     218   
     219        /// <summary>
     220        /// No Metadata Documentation available.
     221        /// </summary>
     222        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     223        [DataMemberAttribute()]
     224        public global::System.Boolean Maximization
     225        {
     226            get
     227            {
     228                return _Maximization;
     229            }
     230            set
     231            {
     232                OnMaximizationChanging(value);
     233                ReportPropertyChanging("Maximization");
     234                _Maximization = StructuralObject.SetValidValue(value);
     235                ReportPropertyChanged("Maximization");
     236                OnMaximizationChanged();
     237            }
     238        }
     239        private global::System.Boolean _Maximization;
     240        partial void OnMaximizationChanging(global::System.Boolean value);
     241        partial void OnMaximizationChanged();
     242   
     243        /// <summary>
     244        /// No Metadata Documentation available.
     245        /// </summary>
     246        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     247        [DataMemberAttribute()]
     248        public global::System.String Weights
     249        {
     250            get
     251            {
     252                return _Weights;
     253            }
     254            set
     255            {
     256                OnWeightsChanging(value);
     257                ReportPropertyChanging("Weights");
     258                _Weights = StructuralObject.SetValidValue(value, false);
     259                ReportPropertyChanged("Weights");
     260                OnWeightsChanged();
     261            }
     262        }
     263        private global::System.String _Weights;
     264        partial void OnWeightsChanging(global::System.String value);
     265        partial void OnWeightsChanged();
     266   
     267        /// <summary>
     268        /// No Metadata Documentation available.
     269        /// </summary>
     270        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     271        [DataMemberAttribute()]
     272        public global::System.String WeightsHash
     273        {
     274            get
     275            {
     276                return _WeightsHash;
     277            }
     278            set
     279            {
     280                OnWeightsHashChanging(value);
     281                ReportPropertyChanging("WeightsHash");
     282                _WeightsHash = StructuralObject.SetValidValue(value, false);
     283                ReportPropertyChanged("WeightsHash");
     284                OnWeightsHashChanged();
     285            }
     286        }
     287        private global::System.String _WeightsHash;
     288        partial void OnWeightsHashChanging(global::System.String value);
     289        partial void OnWeightsHashChanged();
     290   
     291        /// <summary>
     292        /// No Metadata Documentation available.
     293        /// </summary>
     294        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     295        [DataMemberAttribute()]
     296        public global::System.String Distances
     297        {
     298            get
     299            {
     300                return _Distances;
     301            }
     302            set
     303            {
     304                OnDistancesChanging(value);
     305                ReportPropertyChanging("Distances");
     306                _Distances = StructuralObject.SetValidValue(value, false);
     307                ReportPropertyChanged("Distances");
     308                OnDistancesChanged();
     309            }
     310        }
     311        private global::System.String _Distances;
     312        partial void OnDistancesChanging(global::System.String value);
     313        partial void OnDistancesChanged();
     314   
     315        /// <summary>
     316        /// No Metadata Documentation available.
     317        /// </summary>
     318        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     319        [DataMemberAttribute()]
     320        public global::System.String DistancesHash
     321        {
     322            get
     323            {
     324                return _DistancesHash;
     325            }
     326            set
     327            {
     328                OnDistancesHashChanging(value);
     329                ReportPropertyChanging("DistancesHash");
     330                _DistancesHash = StructuralObject.SetValidValue(value, false);
     331                ReportPropertyChanged("DistancesHash");
     332                OnDistancesHashChanged();
     333            }
     334        }
     335        private global::System.String _DistancesHash;
     336        partial void OnDistancesHashChanging(global::System.String value);
     337        partial void OnDistancesHashChanged();
     338   
     339        /// <summary>
     340        /// No Metadata Documentation available.
     341        /// </summary>
     342        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     343        [DataMemberAttribute()]
     344        public global::System.Int32 ProblemSize
     345        {
     346            get
     347            {
     348                return _ProblemSize;
     349            }
     350            set
     351            {
     352                OnProblemSizeChanging(value);
     353                ReportPropertyChanging("ProblemSize");
     354                _ProblemSize = StructuralObject.SetValidValue(value);
     355                ReportPropertyChanged("ProblemSize");
     356                OnProblemSizeChanged();
     357            }
     358        }
     359        private global::System.Int32 _ProblemSize;
     360        partial void OnProblemSizeChanging(global::System.Int32 value);
     361        partial void OnProblemSizeChanged();
    362362
    363363        #endregion
     
    371371        [SoapIgnoreAttribute()]
    372372        [DataMemberAttribute()]
    373         [EdmRelationshipNavigationPropertyAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance", "QAPSolution")]
    374         public EntityCollection<QAPSolution> QAPSolutions
    375         {
    376             get
    377             {
    378                 return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<QAPSolution>("ProblemInstancesModel.FK_QAPSolution_QAPInstance", "QAPSolution");
     373        [EdmRelationshipNavigationPropertyAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance1", "QAPSolution")]
     374        public EntityCollection<QAPSolution> Solutions
     375        {
     376            get
     377            {
     378                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<QAPSolution>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPSolution");
    379379            }
    380380            set
     
    382382                if ((value != null))
    383383                {
    384                     ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<QAPSolution>("ProblemInstancesModel.FK_QAPSolution_QAPInstance", "QAPSolution", value);
     384                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<QAPSolution>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPSolution", value);
    385385                }
    386386            }
     
    403403        /// Create a new QAPSolution object.
    404404        /// </summary>
    405         /// <param name="id">Initial value of the id property.</param>
    406         /// <param name="name">Initial value of the name property.</param>
    407         /// <param name="assignment">Initial value of the assignment property.</param>
    408         /// <param name="assignment_sha1">Initial value of the assignment_sha1 property.</param>
    409         /// <param name="quality">Initial value of the quality property.</param>
    410         public static QAPSolution CreateQAPSolution(global::System.Int32 id, global::System.String name, global::System.String assignment, global::System.String assignment_sha1, global::System.Double quality)
     405        /// <param name="id">Initial value of the Id property.</param>
     406        /// <param name="name">Initial value of the Name property.</param>
     407        /// <param name="assignment">Initial value of the Assignment property.</param>
     408        /// <param name="assignmentHash">Initial value of the AssignmentHash property.</param>
     409        /// <param name="quality">Initial value of the Quality property.</param>
     410        public static QAPSolution CreateQAPSolution(global::System.Int32 id, global::System.String name, global::System.String assignment, global::System.String assignmentHash, global::System.Double quality)
    411411        {
    412412            QAPSolution qAPSolution = new QAPSolution();
    413             qAPSolution.id = id;
    414             qAPSolution.name = name;
    415             qAPSolution.assignment = assignment;
    416             qAPSolution.assignment_sha1 = assignment_sha1;
    417             qAPSolution.quality = quality;
     413            qAPSolution.Id = id;
     414            qAPSolution.Name = name;
     415            qAPSolution.Assignment = assignment;
     416            qAPSolution.AssignmentHash = assignmentHash;
     417            qAPSolution.Quality = quality;
    418418            return qAPSolution;
    419419        }
     
    427427        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
    428428        [DataMemberAttribute()]
    429         public global::System.Int32 id
    430         {
    431             get
    432             {
    433                 return _id;
    434             }
    435             set
    436             {
    437                 if (_id != value)
     429        public global::System.Int32 Id
     430        {
     431            get
     432            {
     433                return _Id;
     434            }
     435            set
     436            {
     437                if (_Id != value)
    438438                {
    439                     OnidChanging(value);
    440                     ReportPropertyChanging("id");
    441                     _id = StructuralObject.SetValidValue(value);
    442                     ReportPropertyChanged("id");
    443                     OnidChanged();
     439                    OnIdChanging(value);
     440                    ReportPropertyChanging("Id");
     441                    _Id = StructuralObject.SetValidValue(value);
     442                    ReportPropertyChanged("Id");
     443                    OnIdChanged();
    444444                }
    445445            }
    446446        }
    447         private global::System.Int32 _id;
    448         partial void OnidChanging(global::System.Int32 value);
    449         partial void OnidChanged();
    450    
    451         /// <summary>
    452         /// No Metadata Documentation available.
    453         /// </summary>
    454         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    455         [DataMemberAttribute()]
    456         public global::System.String name
    457         {
    458             get
    459             {
    460                 return _name;
    461             }
    462             set
    463             {
    464                 OnnameChanging(value);
    465                 ReportPropertyChanging("name");
    466                 _name = StructuralObject.SetValidValue(value, false);
    467                 ReportPropertyChanged("name");
    468                 OnnameChanged();
    469             }
    470         }
    471         private global::System.String _name;
    472         partial void OnnameChanging(global::System.String value);
    473         partial void OnnameChanged();
    474    
    475         /// <summary>
    476         /// No Metadata Documentation available.
    477         /// </summary>
    478         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    479         [DataMemberAttribute()]
    480         public global::System.String assignment
    481         {
    482             get
    483             {
    484                 return _assignment;
    485             }
    486             set
    487             {
    488                 OnassignmentChanging(value);
    489                 ReportPropertyChanging("assignment");
    490                 _assignment = StructuralObject.SetValidValue(value, false);
    491                 ReportPropertyChanged("assignment");
    492                 OnassignmentChanged();
    493             }
    494         }
    495         private global::System.String _assignment;
    496         partial void OnassignmentChanging(global::System.String value);
    497         partial void OnassignmentChanged();
    498    
    499         /// <summary>
    500         /// No Metadata Documentation available.
    501         /// </summary>
    502         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    503         [DataMemberAttribute()]
    504         public global::System.String assignment_sha1
    505         {
    506             get
    507             {
    508                 return _assignment_sha1;
    509             }
    510             set
    511             {
    512                 Onassignment_sha1Changing(value);
    513                 ReportPropertyChanging("assignment_sha1");
    514                 _assignment_sha1 = StructuralObject.SetValidValue(value, false);
    515                 ReportPropertyChanged("assignment_sha1");
    516                 Onassignment_sha1Changed();
    517             }
    518         }
    519         private global::System.String _assignment_sha1;
    520         partial void Onassignment_sha1Changing(global::System.String value);
    521         partial void Onassignment_sha1Changed();
    522    
    523         /// <summary>
    524         /// No Metadata Documentation available.
    525         /// </summary>
    526         [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
    527         [DataMemberAttribute()]
    528         public global::System.Double quality
    529         {
    530             get
    531             {
    532                 return _quality;
    533             }
    534             set
    535             {
    536                 OnqualityChanging(value);
    537                 ReportPropertyChanging("quality");
    538                 _quality = StructuralObject.SetValidValue(value);
    539                 ReportPropertyChanged("quality");
    540                 OnqualityChanged();
    541             }
    542         }
    543         private global::System.Double _quality;
    544         partial void OnqualityChanging(global::System.Double value);
    545         partial void OnqualityChanged();
     447        private global::System.Int32 _Id;
     448        partial void OnIdChanging(global::System.Int32 value);
     449        partial void OnIdChanged();
     450   
     451        /// <summary>
     452        /// No Metadata Documentation available.
     453        /// </summary>
     454        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     455        [DataMemberAttribute()]
     456        public global::System.String Name
     457        {
     458            get
     459            {
     460                return _Name;
     461            }
     462            set
     463            {
     464                OnNameChanging(value);
     465                ReportPropertyChanging("Name");
     466                _Name = StructuralObject.SetValidValue(value, false);
     467                ReportPropertyChanged("Name");
     468                OnNameChanged();
     469            }
     470        }
     471        private global::System.String _Name;
     472        partial void OnNameChanging(global::System.String value);
     473        partial void OnNameChanged();
     474   
     475        /// <summary>
     476        /// No Metadata Documentation available.
     477        /// </summary>
     478        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     479        [DataMemberAttribute()]
     480        public global::System.String Assignment
     481        {
     482            get
     483            {
     484                return _Assignment;
     485            }
     486            set
     487            {
     488                OnAssignmentChanging(value);
     489                ReportPropertyChanging("Assignment");
     490                _Assignment = StructuralObject.SetValidValue(value, false);
     491                ReportPropertyChanged("Assignment");
     492                OnAssignmentChanged();
     493            }
     494        }
     495        private global::System.String _Assignment;
     496        partial void OnAssignmentChanging(global::System.String value);
     497        partial void OnAssignmentChanged();
     498   
     499        /// <summary>
     500        /// No Metadata Documentation available.
     501        /// </summary>
     502        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     503        [DataMemberAttribute()]
     504        public global::System.String AssignmentHash
     505        {
     506            get
     507            {
     508                return _AssignmentHash;
     509            }
     510            set
     511            {
     512                OnAssignmentHashChanging(value);
     513                ReportPropertyChanging("AssignmentHash");
     514                _AssignmentHash = StructuralObject.SetValidValue(value, false);
     515                ReportPropertyChanged("AssignmentHash");
     516                OnAssignmentHashChanged();
     517            }
     518        }
     519        private global::System.String _AssignmentHash;
     520        partial void OnAssignmentHashChanging(global::System.String value);
     521        partial void OnAssignmentHashChanged();
     522   
     523        /// <summary>
     524        /// No Metadata Documentation available.
     525        /// </summary>
     526        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
     527        [DataMemberAttribute()]
     528        public global::System.Double Quality
     529        {
     530            get
     531            {
     532                return _Quality;
     533            }
     534            set
     535            {
     536                OnQualityChanging(value);
     537                ReportPropertyChanging("Quality");
     538                _Quality = StructuralObject.SetValidValue(value);
     539                ReportPropertyChanged("Quality");
     540                OnQualityChanged();
     541            }
     542        }
     543        private global::System.Double _Quality;
     544        partial void OnQualityChanging(global::System.Double value);
     545        partial void OnQualityChanged();
    546546
    547547        #endregion
     
    555555        [SoapIgnoreAttribute()]
    556556        [DataMemberAttribute()]
    557         [EdmRelationshipNavigationPropertyAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance", "QAPInstance")]
    558         public QAPInstance QAPInstance
    559         {
    560             get
    561             {
    562                 return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance", "QAPInstance").Value;
    563             }
    564             set
    565             {
    566                 ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance", "QAPInstance").Value = value;
     557        [EdmRelationshipNavigationPropertyAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance1", "QAPInstance")]
     558        public QAPInstance Instance
     559        {
     560            get
     561            {
     562                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPInstance").Value;
     563            }
     564            set
     565            {
     566                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPInstance").Value = value;
    567567            }
    568568        }
     
    572572        [BrowsableAttribute(false)]
    573573        [DataMemberAttribute()]
    574         public EntityReference<QAPInstance> QAPInstanceReference
    575         {
    576             get
    577             {
    578                 return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance", "QAPInstance");
     574        public EntityReference<QAPInstance> InstanceReference
     575        {
     576            get
     577            {
     578                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPInstance");
    579579            }
    580580            set
     
    582582                if ((value != null))
    583583                {
    584                     ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance", "QAPInstance", value);
     584                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPInstance", value);
    585585                }
    586586            }
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/ProblemInstancesModel.edmx

    r6659 r6733  
    55    <!-- SSDL content -->
    66    <edmx:StorageModels>
    7       <Schema Namespace="ProblemInstancesModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">
     7    <Schema Namespace="ProblemInstancesModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">
    88        <EntityContainer Name="ProblemInstancesModelStoreContainer">
    99          <EntitySet Name="QAPInstance" EntityType="ProblemInstancesModel.Store.QAPInstance" store:Type="Tables" Schema="dbo" />
     
    1616        <EntityType Name="QAPInstance">
    1717          <Key>
    18             <PropertyRef Name="name" />
     18            <PropertyRef Name="Name" />
    1919          </Key>
    20           <Property Name="name" Type="nvarchar" Nullable="false" MaxLength="64" />
    21           <Property Name="description" Type="ntext" />
    22           <Property Name="maximization" Type="bit" Nullable="false" />
    23           <Property Name="weights" Type="text" Nullable="false" />
    24           <Property Name="weights_sha1" Type="char" Nullable="false" MaxLength="40" />
    25           <Property Name="distances" Type="text" Nullable="false" />
    26           <Property Name="distances_sha1" Type="char" Nullable="false" MaxLength="40" />
    27           <Property Name="problemsize" Type="int" Nullable="false" />
     20          <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="64" />
     21          <Property Name="Description" Type="ntext" />
     22          <Property Name="Maximization" Type="bit" Nullable="false" />
     23          <Property Name="Weights" Type="varchar(max)" Nullable="false" />
     24          <Property Name="WeightsHash" Type="char" Nullable="false" MaxLength="40" />
     25          <Property Name="Distances" Type="varchar(max)" Nullable="false" />
     26          <Property Name="DistancesHash" Type="char" Nullable="false" MaxLength="40" />
     27          <Property Name="ProblemSize" Type="int" Nullable="false" />
    2828        </EntityType>
    2929        <EntityType Name="QAPSolution">
    3030          <Key>
    31             <PropertyRef Name="id" />
     31            <PropertyRef Name="Id" />
    3232          </Key>
    33           <Property Name="id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
    34           <Property Name="name" Type="nvarchar" Nullable="false" MaxLength="64" />
    35           <Property Name="assignment" Type="text" Nullable="false" />
    36           <Property Name="assignment_sha1" Type="char" Nullable="false" MaxLength="40" />
    37           <Property Name="quality" Type="float" Nullable="false" />
     33          <Property Name="Id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
     34          <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="64" />
     35          <Property Name="Assignment" Type="text" />
     36          <Property Name="AssignmentHash" Type="char" MaxLength="40" />
     37          <Property Name="Quality" Type="float" Nullable="false" />
    3838        </EntityType>
    3939        <Association Name="FK_QAPSolution_QAPInstance">
     
    4444          <ReferentialConstraint>
    4545            <Principal Role="QAPInstance">
    46               <PropertyRef Name="name" />
     46              <PropertyRef Name="Name" />
    4747            </Principal>
    4848            <Dependent Role="QAPSolution">
    49               <PropertyRef Name="name" />
     49              <PropertyRef Name="Name" />
    5050            </Dependent>
    5151          </ReferentialConstraint>
    5252        </Association>
    53       </Schema>
    54     </edmx:StorageModels>
     53      </Schema></edmx:StorageModels>
    5554    <!-- CSDL content -->
    5655    <edmx:ConceptualModels>
     
    5958          <EntitySet Name="QAPInstances" EntityType="ProblemInstancesModel.QAPInstance" />
    6059          <EntitySet Name="QAPSolutions" EntityType="ProblemInstancesModel.QAPSolution" />
    61           <AssociationSet Name="FK_QAPSolution_QAPInstance" Association="ProblemInstancesModel.FK_QAPSolution_QAPInstance">
     60          <AssociationSet Name="FK_QAPSolution_QAPInstance1" Association="ProblemInstancesModel.FK_QAPSolution_QAPInstance1">
    6261            <End Role="QAPInstance" EntitySet="QAPInstances" />
    6362            <End Role="QAPSolution" EntitySet="QAPSolutions" />
     
    6665        <EntityType Name="QAPInstance">
    6766          <Key>
    68             <PropertyRef Name="name" />
     67            <PropertyRef Name="Name" />
    6968          </Key>
    70           <Property Name="name" Type="String" Nullable="false" MaxLength="64" Unicode="true" FixedLength="false" />
    71           <Property Name="description" Type="String" MaxLength="Max" Unicode="true" FixedLength="false" />
    72           <Property Name="maximization" Type="Boolean" Nullable="false" />
    73           <Property Name="weights" Type="String" Nullable="false" MaxLength="Max" Unicode="false" FixedLength="false" />
    74           <Property Name="weights_sha1" Type="String" Nullable="false" MaxLength="40" Unicode="false" FixedLength="true" />
    75           <Property Name="distances" Type="String" Nullable="false" MaxLength="Max" Unicode="false" FixedLength="false" />
    76           <Property Name="distances_sha1" Type="String" Nullable="false" MaxLength="40" Unicode="false" FixedLength="true" />
    77           <Property Name="problemsize" Type="Int32" Nullable="false" />
    78           <NavigationProperty Name="QAPSolutions" Relationship="ProblemInstancesModel.FK_QAPSolution_QAPInstance" FromRole="QAPInstance" ToRole="QAPSolution" />
     69          <Property Type="String" Name="Name" Nullable="false" MaxLength="64" FixedLength="false" Unicode="true" />
     70          <Property Type="String" Name="Description" MaxLength="Max" FixedLength="false" Unicode="true" />
     71          <Property Type="Boolean" Name="Maximization" Nullable="false" />
     72          <Property Type="String" Name="Weights" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" />
     73          <Property Type="String" Name="WeightsHash" Nullable="false" MaxLength="40" FixedLength="true" Unicode="false" />
     74          <Property Type="String" Name="Distances" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" />
     75          <Property Type="String" Name="DistancesHash" Nullable="false" MaxLength="40" FixedLength="true" Unicode="false" />
     76          <NavigationProperty Name="Solutions" Relationship="ProblemInstancesModel.FK_QAPSolution_QAPInstance1" FromRole="QAPInstance" ToRole="QAPSolution" />
     77          <Property Type="Int32" Name="ProblemSize" Nullable="false" />
    7978        </EntityType>
    8079        <EntityType Name="QAPSolution">
    8180          <Key>
    82             <PropertyRef Name="id" />
     81            <PropertyRef Name="Id" />
    8382          </Key>
    84           <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    85           <Property Name="name" Type="String" Nullable="false" MaxLength="64" Unicode="true" FixedLength="false" />
    86           <Property Name="assignment" Type="String" Nullable="false" MaxLength="Max" Unicode="false" FixedLength="false" />
    87           <Property Name="assignment_sha1" Type="String" Nullable="false" MaxLength="40" Unicode="false" FixedLength="true" />
    88           <Property Name="quality" Type="Double" Nullable="false" />
    89           <NavigationProperty Name="QAPInstance" Relationship="ProblemInstancesModel.FK_QAPSolution_QAPInstance" FromRole="QAPSolution" ToRole="QAPInstance" />
     83          <Property Type="Int32" Name="Id" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
     84          <Property Type="String" Name="Name" Nullable="false" MaxLength="64" FixedLength="false" Unicode="true" />
     85          <Property Type="String" Name="Assignment" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" />
     86          <Property Type="String" Name="AssignmentHash" Nullable="false" MaxLength="40" FixedLength="true" Unicode="false" />
     87          <Property Type="Double" Name="Quality" Nullable="false" />
     88          <NavigationProperty Name="Instance" Relationship="ProblemInstancesModel.FK_QAPSolution_QAPInstance1" FromRole="QAPSolution" ToRole="QAPInstance" />
    9089        </EntityType>
    91         <Association Name="FK_QAPSolution_QAPInstance">
    92           <End Role="QAPInstance" Type="ProblemInstancesModel.QAPInstance" Multiplicity="1">
    93             <OnDelete Action="Cascade" />
    94           </End>
    95           <End Role="QAPSolution" Type="ProblemInstancesModel.QAPSolution" Multiplicity="*" />
     90        <Association Name="FK_QAPSolution_QAPInstance1">
     91          <End Type="ProblemInstancesModel.QAPInstance" Role="QAPInstance" Multiplicity="1" />
     92          <End Type="ProblemInstancesModel.QAPSolution" Role="QAPSolution" Multiplicity="*" />
    9693          <ReferentialConstraint>
    9794            <Principal Role="QAPInstance">
    98               <PropertyRef Name="name" />
     95              <PropertyRef Name="Name" />
    9996            </Principal>
    10097            <Dependent Role="QAPSolution">
    101               <PropertyRef Name="name" />
     98              <PropertyRef Name="Name" />
    10299            </Dependent>
    103100          </ReferentialConstraint>
     
    110107        <EntityContainerMapping StorageEntityContainer="ProblemInstancesModelStoreContainer" CdmEntityContainer="ProblemInstancesEntities">
    111108          <EntitySetMapping Name="QAPInstances"><EntityTypeMapping TypeName="ProblemInstancesModel.QAPInstance"><MappingFragment StoreEntitySet="QAPInstance">
    112             <ScalarProperty Name="name" ColumnName="name" />
    113             <ScalarProperty Name="description" ColumnName="description" />
    114             <ScalarProperty Name="maximization" ColumnName="maximization" />
    115             <ScalarProperty Name="weights" ColumnName="weights" />
    116             <ScalarProperty Name="weights_sha1" ColumnName="weights_sha1" />
    117             <ScalarProperty Name="distances" ColumnName="distances" />
    118             <ScalarProperty Name="distances_sha1" ColumnName="distances_sha1" />
    119             <ScalarProperty Name="problemsize" ColumnName="problemsize" />
    120           </MappingFragment></EntityTypeMapping></EntitySetMapping>
     109            <ScalarProperty Name="ProblemSize" ColumnName="ProblemSize" />
     110                <ScalarProperty Name="DistancesHash" ColumnName="DistancesHash" />
     111                <ScalarProperty Name="Distances" ColumnName="Distances" />
     112                <ScalarProperty Name="WeightsHash" ColumnName="WeightsHash" />
     113                <ScalarProperty Name="Weights" ColumnName="Weights" />
     114                <ScalarProperty Name="Maximization" ColumnName="Maximization" />
     115                <ScalarProperty Name="Description" ColumnName="Description" />
     116                <ScalarProperty Name="Name" ColumnName="Name" />
     117              </MappingFragment></EntityTypeMapping></EntitySetMapping>
    121118          <EntitySetMapping Name="QAPSolutions"><EntityTypeMapping TypeName="ProblemInstancesModel.QAPSolution"><MappingFragment StoreEntitySet="QAPSolution">
    122             <ScalarProperty Name="id" ColumnName="id" />
    123             <ScalarProperty Name="name" ColumnName="name" />
    124             <ScalarProperty Name="assignment" ColumnName="assignment" />
    125             <ScalarProperty Name="assignment_sha1" ColumnName="assignment_sha1" />
    126             <ScalarProperty Name="quality" ColumnName="quality" />
    127           </MappingFragment></EntityTypeMapping></EntitySetMapping>
     119            <ScalarProperty Name="Quality" ColumnName="Quality" />
     120                <ScalarProperty Name="AssignmentHash" ColumnName="AssignmentHash" />
     121                <ScalarProperty Name="Assignment" ColumnName="Assignment" />
     122                <ScalarProperty Name="Name" ColumnName="Name" />
     123                <ScalarProperty Name="Id" ColumnName="Id" />
     124              </MappingFragment></EntityTypeMapping></EntitySetMapping>
    128125        </EntityContainerMapping>
    129126      </Mapping>
     
    148145      <Diagram Name="ProblemInstancesModel">
    149146        <EntityTypeShape EntityType="ProblemInstancesModel.QAPInstance" Width="1.5" PointX="0.75" PointY="1" Height="2.7494921874999996" IsExpanded="true" />
    150         <EntityTypeShape EntityType="ProblemInstancesModel.QAPSolution" Width="1.5" PointX="3" PointY="1.25" Height="2.1725878906249996" IsExpanded="true" />
    151         <AssociationConnector Association="ProblemInstancesModel.FK_QAPSolution_QAPInstance" ManuallyRouted="false">
     147        <EntityTypeShape EntityType="ProblemInstancesModel.QAPSolution" Width="1.5" PointX="3" PointY="1.25" Height="2.172587890625" IsExpanded="true" />
     148        <AssociationConnector Association="ProblemInstancesModel.FK_QAPSolution_QAPInstance1" >
    152149          <ConnectorPoint PointX="2.25" PointY="2.3362939453125" />
    153150          <ConnectorPoint PointX="3" PointY="2.3362939453125" />
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/QAP/QAP.svc.cs

    r6659 r6733  
    2626    public string[] GetProblemInstances() {
    2727      using (ProblemInstancesEntities context = new ProblemInstancesEntities()) {
    28         return context.QAPInstances.Select(x => x.name).ToArray();
     28        return context.QAPInstances.Select(x => x.Name).ToArray();
    2929      }
    3030    }
     
    3232    public QAPInstanceDto GetProblemInstanceData(string instance) {
    3333      using (ProblemInstancesEntities context = new ProblemInstancesEntities()) {
    34         return new QAPInstanceDto(context.QAPInstances.Where(x => x.name == instance).Single());
     34        return new QAPInstanceDto(context.QAPInstances.Where(x => x.Name == instance).Single());
    3535      }
    3636    }
     
    3838    public QAPSolutionDto[] GetBestSolutionsData(string instance) {
    3939      using (ProblemInstancesEntities context = new ProblemInstancesEntities()) {
    40         QAPInstance qap = context.QAPInstances.Where(x => x.name == instance).SingleOrDefault();
     40        QAPInstance qap = context.QAPInstances.Where(x => x.Name == instance).SingleOrDefault();
    4141        if (qap == null) return new QAPSolutionDto[0];
     42        context.LoadProperty<QAPInstance>(qap, x => x.Solutions);
    4243        double best = double.NaN;
    43         if (qap.maximization) best = qap.QAPSolutions.Max(x => x.quality);
    44         else best = qap.QAPSolutions.Min(x => x.quality);
     44        if (!qap.Solutions.Any()) return new QAPSolutionDto[0];
    4545
    46         return qap.QAPSolutions.Where(x => x.quality == best).Select(x => new QAPSolutionDto(x)).ToArray();
     46        if (qap.Maximization) best = qap.Solutions.Max(x => x.Quality);
     47        else best = qap.Solutions.Min(x => x.Quality);
     48
     49        return qap.Solutions.Where(x => x.Quality == best).Select(x => new QAPSolutionDto(x)).ToArray();
    4750      }
    4851    }
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/QAP/QAPInstanceDto.cs

    r6659 r6733  
    1 
    2 #region License Information
     1#region License Information
    32/* HeuristicLab
    43 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     
    2221
    2322using System;
     23using System.Linq;
    2424using System.Runtime.Serialization;
    2525
     
    3737    [DataMember]
    3838    public double[][] Distances { get; set; }
     39    [DataMember]
     40    public double BestKnownQuality { get; set; }
     41    [DataMember]
     42    public bool HasBestKnownQuality { get; set; }
    3943
    4044    public QAPInstanceDto() {
     
    4347
    4448    public QAPInstanceDto(QAPInstance qAPInstance) {
    45       Name = qAPInstance.name;
    46       Description = qAPInstance.description;
    47       Maximization = qAPInstance.maximization;
     49      Name = qAPInstance.Name;
     50      Description = qAPInstance.Description;
     51      Maximization = qAPInstance.Maximization;
    4852      try {
    49         Weights = PrimitiveSerializer.DeserializeDoubleMatrix(qAPInstance.weights);
    50         Distances = PrimitiveSerializer.DeserializeDoubleMatrix(qAPInstance.distances);
     53        Weights = SimpleSerializer.DeserializeDoubleMatrix(qAPInstance.Weights);
     54        Distances = SimpleSerializer.DeserializeDoubleMatrix(qAPInstance.Distances);
    5155      } catch (ArgumentException e) {
    52         throw new PrimitiveSerializationException("Failed to deserialize the weights or distance matrix.", e);
     56        throw new SimpleSerializationException("Failed to deserialize the weights or distance matrix.", e);
     57      }
     58      BestKnownQuality = double.NaN;
     59      HasBestKnownQuality = false;
     60      if (qAPInstance.Solutions.Any()) {
     61        double bestQuality;
     62        if (Maximization) bestQuality = qAPInstance.Solutions.Max(x => x.Quality);
     63        else bestQuality = qAPInstance.Solutions.Min(x => x.Quality);
     64        HasBestKnownQuality = true;
    5365      }
    5466    }
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/QAP/QAPSolutionDto.cs

    r6659 r6733  
    1 
    2 #region License Information
     1#region License Information
    32/* HeuristicLab
    43 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     
    2120#endregion
    2221
     22using System;
    2323using System.Runtime.Serialization;
    2424
     
    2727  public class QAPSolutionDto {
    2828    [DataMember]
     29    public bool AssignmentUndefined { get; set; }
     30    [DataMember]
    2931    public int[] Assignment { get; set; }
    3032    [DataMember]
     
    3234
    3335    public QAPSolutionDto() {
    34 
     36      Quality = double.NaN;
    3537    }
    3638
    3739    public QAPSolutionDto(QAPSolution x) {
    38       Assignment = PrimitiveSerializer.DeserializeIntArray(x.assignment);
    39       Quality = x.quality;
     40      AssignmentUndefined = String.IsNullOrEmpty(x.Assignment);
     41      if (!AssignmentUndefined)
     42        Assignment = SimpleSerializer.DeserializeIntArray(x.Assignment);
     43      Quality = x.Quality;
    4044    }
    4145  }
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/Web.Debug.config

    r6659 r6733  
    44
    55<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    6 
     6  <connectionStrings xdt:Transform="Insert">
     7    <add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=LOCALHOST\SQLEXPRESS;Initial Catalog=HeuristicLab.ProblemInstances;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
     8  </connectionStrings>
    79</configuration>
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/Web.Release.config

    r6659 r6733  
    99  </system.web>
    1010
     11  <connectionStrings xdt:Transform="Insert">
     12    <add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=LOCALHOST;Initial Catalog=HeuristicLab.ProblemInstances;Integrated Security=True&quot;" providerName="System.Data.EntityClient" />
     13  </connectionStrings>
    1114</configuration>
  • branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/Web.config

    r6659 r6733  
    99      <serviceBehaviors>
    1010        <behavior>
     11          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
    1112          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
    1213          <serviceMetadata httpGetEnabled="true" />
    1314          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
    14           <serviceDebug includeExceptionDetailInFaults="false" />
     15          <serviceDebug includeExceptionDetailInFaults="true" />
    1516        </behavior>
    1617      </serviceBehaviors>
     
    2223  </system.webServer>
    2324 
    24 <connectionStrings><add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=MRPINK\SQLEXPRESS;Initial Catalog=ProblemInstances;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /></connectionStrings></configuration>
     25</configuration>
Note: See TracChangeset for help on using the changeset viewer.