C# Class Fhnw.Ecnf.RoutePlanner.RoutePlannerLib.Routes

Manages a routes from a city to another city.
Inheritance: IRoutes
Show file Open project: platzhersh/FHNW-Java-Projekte Class Usage Examples

Protected Properties

Property Type Description
cities Cities
routes List

Public Methods

Method Description
FindCities ( TransportModes tmode ) : Fhnw.Ecnf.RoutePlanner.RoutePlannerLib.City[]
FindCitiesBetween ( string fromName, string toName ) : List

Find all cities between 2 cities

FindShortestRouteBetween ( string fromCity, string toCity, TransportModes mode ) : List
FindShortestRouteBetween ( string fromCity, string toCity, TransportModes mode, IProgress reportProgress = null ) : List

Calculates and returns the shortest route between the passed cities.

FindShortestRouteBetweenAsync ( string fromCity, string toCity, TransportModes mode, IProgress reportProgress ) : Task>
GoFindShortestRouteBetween ( string fromCity, string toCity, TransportModes mode, IProgress reportProgress = null ) : Task>
ReadRoutes ( string filename ) : int

Reads a list of links from the given file. Reads only links where the cities exist.

Routes ( Cities cities ) : System.Diagnostics

Initializes the Routes with the cities.

Protected Methods

Method Description
FindLink ( City c1, City c2, TransportModes t ) : Link

Finds the link between two cities.

FindPath ( List citiesOnRoute, TransportModes mode ) : List
NotifyObservers ( string fromCity, string toCity, TransportModes mode ) : void

Private Methods

Method Description
FindNeighbours ( City city, TransportModes mode ) : List

Finds all neighbor cities of a city.

GetCitiesOnRoute ( City source, City target, City>.Dictionary previous ) : List
SearchShortestPath ( TransportModes mode, List q, double>.Dictionary dist, City>.Dictionary previous ) : City>.Dictionary

Searches the shortest path for cities and the given links

Method Details

FindCities() public method

public FindCities ( TransportModes tmode ) : Fhnw.Ecnf.RoutePlanner.RoutePlannerLib.City[]
tmode TransportModes
return Fhnw.Ecnf.RoutePlanner.RoutePlannerLib.City[]

FindCitiesBetween() public method

Find all cities between 2 cities
public FindCitiesBetween ( string fromName, string toName ) : List
fromName string source city
toName string target city
return List

FindLink() protected method

Finds the link between two cities.
protected FindLink ( City c1, City c2, TransportModes t ) : Link
c1 City first city
c2 City second city
t TransportModes
return Link

FindPath() protected method

protected FindPath ( List citiesOnRoute, TransportModes mode ) : List
citiesOnRoute List
mode TransportModes
return List

FindShortestRouteBetween() public method

public FindShortestRouteBetween ( string fromCity, string toCity, TransportModes mode ) : List
fromCity string
toCity string
mode TransportModes
return List

FindShortestRouteBetween() public abstract method

Calculates and returns the shortest route between the passed cities.
public abstract FindShortestRouteBetween ( string fromCity, string toCity, TransportModes mode, IProgress reportProgress = null ) : List
fromCity string
toCity string
mode TransportModes
reportProgress IProgress
return List

FindShortestRouteBetweenAsync() public method

public FindShortestRouteBetweenAsync ( string fromCity, string toCity, TransportModes mode, IProgress reportProgress ) : Task>
fromCity string
toCity string
mode TransportModes
reportProgress IProgress
return Task>

GoFindShortestRouteBetween() public method

public GoFindShortestRouteBetween ( string fromCity, string toCity, TransportModes mode, IProgress reportProgress = null ) : Task>
fromCity string
toCity string
mode TransportModes
reportProgress IProgress
return Task>

NotifyObservers() protected method

protected NotifyObservers ( string fromCity, string toCity, TransportModes mode ) : void
fromCity string
toCity string
mode TransportModes
return void

ReadRoutes() public method

Reads a list of links from the given file. Reads only links where the cities exist.
public ReadRoutes ( string filename ) : int
filename string name of links file
return int

Routes() public method

Initializes the Routes with the cities.
public Routes ( Cities cities ) : System.Diagnostics
cities Cities
return System.Diagnostics

Property Details

cities protected property

protected Cities,Fhnw.Ecnf.RoutePlanner.RoutePlannerLib cities
return Cities

routes protected property

protected List routes
return List