Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/18/16 13:24:28 (8 years ago)
Author:
thasling
Message:

Connectionstring to peerlistserver now in app.config

Location:
branches/thasling/DistributedGA/DistributedGA.Test
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/thasling/DistributedGA/DistributedGA.Test/App.config

    r13524 r13538  
    44        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    55    </startup>
     6  <appSettings>
     7    <add key="ContactServerURL" value="http://localhost:9090/DistributedGA.ContactServer/ContactService"/>
     8  </appSettings>
    69</configuration>
  • branches/thasling/DistributedGA/DistributedGA.Test/Form1.cs

    r13524 r13538  
    1 using DistributedGA.Core;
     1using System;
     2using System.Collections.Generic;
     3using System.Windows.Forms;
     4using DistributedGA.Core;
    25using DistributedGA.Core.Domain;
    36using DistributedGA.Core.Implementation;
    47using DistributedGA.Core.Interface;
    5 using System;
    6 using System.Collections.Generic;
    7 using System.ComponentModel;
    8 using System.Data;
    9 using System.Drawing;
    10 using System.Linq;
    11 using System.Text;
    12 using System.Threading;
    13 using System.Threading.Tasks;
    14 using System.Windows.Forms;
    158
    16 namespace DistributedGA.Test
    17 {
    18     public partial class Form1 : Form
    19     {
    20         public Form1()
    21         {
    22             InitializeComponent();
     9namespace DistributedGA.Test {
     10  public partial class Form1 : Form {
     11    public Form1() {
     12      InitializeComponent();
     13    }
     14
     15    private void button1_Click(object sender, EventArgs e) {
     16      IMessageService s = new WcfMessageService();
     17      s.Init("");
     18    }
     19
     20    private void button2_Click(object sender, EventArgs e) {
     21      IMessageSender c = new WcfMessageSender();
     22      c.Init(null);
     23      c.SendPopulation(null, null);
     24    }
     25
     26    private void button3_Click(object sender, EventArgs e) {
     27      IMessageHandler h1 = new PeerNetworkMessageHandler();
     28      h1.Init();
     29      IMessageHandler h2 = new PeerNetworkMessageHandler();
     30      h2.Init();
     31      IMessageHandler h3 = new PeerNetworkMessageHandler();
     32      h3.Init();
     33      IMessageHandler h4 = new PeerNetworkMessageHandler();
     34      h4.Init();
     35      IMessageHandler h5 = new PeerNetworkMessageHandler();
     36      h5.Init();
     37      var pop1 = CreatePopulation();
     38      h1.PublishMigrationInfo(pop1);
     39      h1.PublishMigrationInfo(pop1);
     40      var res1 = h1.GetMigrationInfo();
     41      var res2 = h2.GetMigrationInfo();
     42      h1.PublishMigrationInfo(pop1);
     43      h1.PublishMigrationInfo(pop1);
     44      var res3 = h1.GetMigrationInfo();
     45      var res4 = h2.GetMigrationInfo();
     46      h1.PublishMigrationInfo(pop1);
     47      h1.PublishMigrationInfo(pop1);
     48      var res5 = h1.GetMigrationInfo();
     49      var res6 = h2.GetMigrationInfo();
     50      int i = 0;
     51    }
     52
     53    private void button4_Click(object sender, EventArgs e) {
     54      var l = new WcfPeerListManager();
     55      l.Init(CreatePeerInfo());
     56      l.GetPeerList();
     57    }
     58
     59    private void button5_Click(object sender, EventArgs e) {
     60      Dictionary<string, int> d1 = new Dictionary<string, int>();
     61      d1.Add("test", 5);
     62      if (d1.ContainsKey("test")) {
     63        int i = 0;
     64      } else {
     65        int j = 0;
     66      }
     67      Dictionary<PeerInfo, int> d2 = new Dictionary<PeerInfo, int>();
     68      PeerInfo p1 = CreatePeerInfo();
     69      PeerInfo p2 = CreatePeerInfo();
     70      d2.Add(p1, 5);
     71      if (d2.ContainsKey(p1)) {
     72        int i = 0;
     73      }
     74      if (d2.ContainsKey(p2)) {
     75        int i = 0;
     76      }
     77    }
     78
     79    private PeerInfo CreatePeerInfo() {
     80      return new PeerInfo() { IpAddress = "192.168.0.4", Port = 3030 };
     81    }
     82
     83    private SolutionInfo[] CreatePopulation() {
     84      SolutionInfo si1 = new SolutionInfo() {
     85        IterationNumber = 1,
     86        Quality = 3.5f,
     87        Solution = new Solution() {
    2388        }
    24 
    25         private void button1_Click(object sender, EventArgs e)
    26         {
    27             IMessageService s = new WcfMessageService();
    28             s.Init("");
     89      };
     90      SolutionInfo si2 = new SolutionInfo() {
     91        IterationNumber = 2,
     92        Quality = 3.5f,
     93        Solution = new Solution() {
    2994        }
    30 
    31         private void button2_Click(object sender, EventArgs e)
    32         {
    33             IMessageSender c = new WcfMessageSender();
    34             c.Init(null);
    35             c.SendPopulation(null, null);
     95      };
     96      SolutionInfo si3 = new SolutionInfo() {
     97        IterationNumber = 3,
     98        Quality = 3.5f,
     99        Solution = new Solution() {
    36100        }
    37 
    38         private void button3_Click(object sender, EventArgs e)
    39         {
    40             IMessageHandler h1 = new PeerNetworkMessageHandler();
    41             h1.Init();
    42             IMessageHandler h2 = new PeerNetworkMessageHandler();
    43             h2.Init();
    44             IMessageHandler h3 = new PeerNetworkMessageHandler();
    45             h3.Init();
    46             IMessageHandler h4 = new PeerNetworkMessageHandler();
    47             h4.Init();
    48             IMessageHandler h5 = new PeerNetworkMessageHandler();
    49             h5.Init();
    50             var pop1 = CreatePopulation();
    51             h1.PublishMigrationInfo(pop1);
    52             h1.PublishMigrationInfo(pop1);
    53             var res1 = h1.GetMigrationInfo();
    54             var res2 = h2.GetMigrationInfo();
    55             h1.PublishMigrationInfo(pop1);
    56             h1.PublishMigrationInfo(pop1);
    57             var res3 = h1.GetMigrationInfo();
    58             var res4 = h2.GetMigrationInfo();
    59             h1.PublishMigrationInfo(pop1);
    60             h1.PublishMigrationInfo(pop1);
    61             var res5 = h1.GetMigrationInfo();
    62             var res6 = h2.GetMigrationInfo();
    63             int i = 0;
    64         }
    65 
    66         private void button4_Click(object sender, EventArgs e)
    67         {
    68             var l = new WcfPeerListManager();
    69             l.Init(CreatePeerInfo());
    70             l.GetPeerList();
    71         }     
    72 
    73         private void button5_Click(object sender, EventArgs e)
    74         {
    75             Dictionary<string, int> d1 = new Dictionary<string, int>();
    76             d1.Add("test", 5);
    77             if(d1.ContainsKey("test"))
    78             {
    79                 int i = 0;
    80             }
    81             else
    82             {
    83                 int j = 0;
    84             }
    85             Dictionary<PeerInfo, int> d2 = new Dictionary<PeerInfo, int>();
    86             PeerInfo p1 = CreatePeerInfo();
    87             PeerInfo p2 = CreatePeerInfo();
    88             d2.Add(p1, 5);
    89             if (d2.ContainsKey(p1))
    90             {
    91                 int i = 0;
    92             }
    93             if(d2.ContainsKey(p2))
    94             {
    95                 int i = 0;
    96             }
    97         }
    98 
    99         private PeerInfo CreatePeerInfo()
    100         {
    101             return new PeerInfo() { IpAddress = "192.168.0.4", Port = 3030 };
    102         }
    103 
    104         private  SolutionInfo[] CreatePopulation()
    105         {
    106             SolutionInfo si1 = new SolutionInfo()
    107             {
    108                 IterationNumber = 1,
    109                 Quality = 3.5f,
    110                 Solution = new Solution()
    111                 {
    112                 }
    113             };
    114             SolutionInfo si2 = new SolutionInfo()
    115             {
    116                 IterationNumber = 2,
    117                 Quality = 3.5f,
    118                 Solution = new Solution()
    119                 {
    120                 }
    121             };
    122             SolutionInfo si3 = new SolutionInfo()
    123             {
    124                 IterationNumber = 3,
    125                 Quality = 3.5f,
    126                 Solution = new Solution()
    127                 {
    128                 }
    129             };
    130             return new SolutionInfo[] { si1, si2, si3 };
    131         }
     101      };
     102      return new SolutionInfo[] { si1, si2, si3 };
    132103    }
     104  }
    133105}
  • branches/thasling/DistributedGA/DistributedGA.Test/bin/Debug/DistributedGA.Test.exe.config

    r13524 r13538  
    44        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    55    </startup>
     6  <appSettings>
     7    <add key="ContactServerURL" value="http://localhost:9090/DistributedGA.ContactServer/ContactService"/>
     8  </appSettings>
    69</configuration>
  • branches/thasling/DistributedGA/DistributedGA.Test/obj/Debug/DistributedGA.Test.csproj.FileListAbsolute.txt

    r13537 r13538  
    2424C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.exe
    2525C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.pdb
     26C:\Public\SVN\DistributedGA\DistributedGA.Test\bin\Debug\DistributedGA.Test.exe
     27C:\Public\SVN\DistributedGA\DistributedGA.Test\bin\Debug\DistributedGA.Test.pdb
     28C:\Public\SVN\DistributedGA\DistributedGA.Test\bin\Debug\DistributedGA.Core.dll
     29C:\Public\SVN\DistributedGA\DistributedGA.Test\bin\Debug\DistributedGA.Core.pdb
     30C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.csprojResolveAssemblyReference.cache
     31C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.Form1.resources
     32C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.Properties.Resources.resources
     33C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.csproj.GenerateResource.Cache
Note: See TracChangeset for help on using the changeset viewer.