-
Notifications
You must be signed in to change notification settings - Fork 0
/
StationEdge.java
68 lines (65 loc) · 1.36 KB
/
StationEdge.java
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
/**
* *
* * StationEdge.java – Assignment1
* * @author: Jeremiah Smith, Juyong Kim
* * @student Number: c3238179 c3244203
* * @version: 016/10/2018
* * Description: Holds information to create and store a StationEdge object
* */
public class StationEdge
{
//variables
private String Name;
private String Line;
private int Duration;
private Station Source;
private Station Destination;
private int defaultTime;
private int changes;
//constructor
public StationEdge(String Name, String Line, int Duration, Station Source, Station Destination)
{
this.Name = Name;
this.Line = Line;
this.Duration = Duration;
this.Source = Source;
this.Destination = Destination;
defaultTime = 1;
changes = 0;
}
//functions
public int getValue(String optimisationCriteria) //depening on optimisation criteria
{ //returns either the duration or changes
int value = 0;
if (optimisationCriteria == "time")
value = Duration;
else if (optimisationCriteria == "changes")
value = changes;
return value;
}
//getters
public String getName()
{
return Name;
}
public String getLine()
{
return Line;
}
public int getDuration()
{
return Duration;
}
public Station getSource()
{
return Source;
}
public Station getDestination()
{
return Destination;
}
public int getDefault()
{
return defaultTime;
}
}