|
Revision 3, 1.8 kB
(checked in by dpaola2, 4 years ago)
|
old pathways project added
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
public abstract class Search { |
|---|
| 8 |
public Node getOrigin() { return origin; } |
|---|
| 9 |
public Node getDestination() { return destination; } |
|---|
| 10 |
public double getWalkingSpeed() { return walkingSpeed; } |
|---|
| 11 |
public boolean getBusEnable() { return busEnable; } |
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
public void setOrigin(PhysicalNode o) { origin = o; } |
|---|
| 15 |
public void setDestination(PhysicalNode d ) { destination = d; } |
|---|
| 16 |
|
|---|
| 17 |
public void setWalkingSpeed(double s) { walkingSpeed = s; fastestTransportationSpeed = s; } |
|---|
| 18 |
public void setBusEnable(boolean e) { |
|---|
| 19 |
busEnable = e; |
|---|
| 20 |
if(busEnable) |
|---|
| 21 |
fastestTransportationSpeed = 10; |
|---|
| 22 |
else |
|---|
| 23 |
fastestTransportationSpeed = walkingSpeed; |
|---|
| 24 |
} |
|---|
| 25 |
|
|---|
| 26 |
Search() { |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
fastestTransportationSpeed = 1.4; |
|---|
| 31 |
this.walkingSpeed = 1.4; |
|---|
| 32 |
} |
|---|
| 33 |
|
|---|
| 34 |
Search(PhysicalNode origin, PhysicalNode destination, double walkingSpeed) { |
|---|
| 35 |
this.origin = origin; |
|---|
| 36 |
this.destination = destination; |
|---|
| 37 |
fastestTransportationSpeed = walkingSpeed; |
|---|
| 38 |
this.walkingSpeed = walkingSpeed; |
|---|
| 39 |
} |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
public abstract Path computeBestPath(); |
|---|
| 47 |
|
|---|
| 48 |
protected PhysicalNode origin, destination; |
|---|
| 49 |
|
|---|
| 50 |
protected double fastestTransportationSpeed; |
|---|
| 51 |
protected double walkingSpeed; |
|---|
| 52 |
protected boolean busEnable; |
|---|
| 53 |
} |
|---|
| 54 |
|
|---|