-
Notifications
You must be signed in to change notification settings - Fork 2
/
TspEventArgs.cs
98 lines (92 loc) · 3.37 KB
/
TspEventArgs.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//////////////////////////////////////////////////////////////////////////////////////////////////
// File Name: TspEventArgs.cs
// Permission to use, copy, modify, and distribute this Program and its documentation,
// if any, for any purpose and without fee is hereby granted, provided that:
// (i) you not charge any fee for the Program, and the Program not be incorporated
// by you in any software or code for which compensation is expected or received;
// (ii) the copyright notice listed above appears in all copies;
// (iii) both the copyright notice and this Agreement appear in all supporting documentation; and
// (iv) the name of Michael LaLena or lalena.com not be used in advertising or publicity
// pertaining to distribution of the Program without specific, written prior permission.
///////////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;
namespace Tsp
{
/// <summary>
/// Event arguments when the TSP class wants the GUI to draw a tour.
/// </summary>
public class TspEventArgs : EventArgs
{
/// <summary>
/// Default Constructor.
/// </summary>
public TspEventArgs()
{
}
/// <summary>
/// Constructor that sets all the properties.
/// </summary>
/// <param name="cityList">The list of cities to draw.</param>
/// <param name="bestTour">The tour that connects all the cities.</param>
/// <param name="generation">Which generation is this.</param>
/// <param name="complete">Is this the last update before we are done.</param>
public TspEventArgs(Cities cityList, Tour bestTour, int generation, bool complete)
{
this.cityList = cityList;
this.bestTour = bestTour;
this.generation = generation;
this.complete = complete;
}
/// <summary>Private copy of the list of cities.</summary>
private Cities cityList;
/// <summary>Public property for list of cities.</summary>
public Cities CityList
{
get
{
return cityList;
}
}
/// <summary>Private copy of the tour of the cities.</summary>
private Tour bestTour;
/// <summary>Public property for the tour of the cities.</summary>
public Tour BestTour
{
get
{
return bestTour;
}
}
/// <summary>Private copy for which generation this tour came from.</summary>
private int generation;
/// <summary>Public property for which generation this tour came from.</summary>
public int Generation
{
get
{
return generation;
}
set
{
generation = value;
}
}
/// <summary>Private copy indicating if the TSP algorithm is complete.</summary>
private bool complete = false;
/// <summary>Public property indicating if the TSP algorithm is complete.</summary>
public bool Complete
{
get
{
return complete;
}
set
{
complete = value;
}
}
}
}