public class InitializeProcess extends ProcessCommon implements java.util.concurrent.Callable<InitializeProcess.Output>
| Modifier and Type | Class and Description |
|---|---|
class |
InitializeProcess.Output
Class which holds the output of the InitializeProcess
|
| Modifier and Type | Field and Description |
|---|---|
protected android.content.Context |
context
Context under which the initialize process is being run
|
protected static java.lang.String |
LOG_BEACONS_DONE |
protected static java.lang.String |
LOG_BEACONS_FUTURE |
protected static java.lang.String |
LOG_FAILED_BD
Log messages
|
protected static java.lang.String |
LOG_FAILED_BEACONS |
protected static java.lang.String |
LOG_RECIEVED_BUILDING_ID |
protected java.util.List<java.lang.String> |
userInput
The user input
|
| Constructor and Description |
|---|
InitializeProcess(android.content.Context context,
java.util.List<java.lang.String> userInput)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
InitializeProcess.Output |
call() |
protected double |
distanceBetweenNodes(GridNode nodeA,
GridNode nodeB)
Calculate the distance between the 2 given nodes using the distance
formula
|
protected java.util.List<GridNode> |
findClosestNode(java.util.Set<GridNode> nodes,
GridNode start,
FloorSequencer pathfinder)
Find closest node to the given start node using a more robust method
NOTE: This calculates the path for the all given nodes and is therefore
slow
|
protected GridNode |
findClosestNodeNaive(java.util.Set<GridNode> nodes,
GridNode start)
Find closest node to the given start node using a naive distance
formula method
|
protected Building |
getBuildingData(java.lang.String buildingID)
Fetches the data for the building corresponding to the given building id
|
protected BuildingDetector.Output |
getCurrentBuilding()
Uses the BuilderDetector class to find the the of the building the user
is in
|
protected DestinationType |
getDestinationType(UserInputParser inputParser)
Gets the destination type from the user input
|
protected GridNode |
getNonGenericDestination(DestinationType destinationType,
UserInputParser inputParser,
DestinationTable destinationTable)
Excracts a non-generic desitination from the Destination table accoring
to the users input
|
protected double |
pathDistance(java.util.List<GridNode> path)
Calculate the total distance of the given path
|
getUserLocationProximityprotected static final java.lang.String LOG_FAILED_BD
protected static final java.lang.String LOG_FAILED_BEACONS
protected static final java.lang.String LOG_RECIEVED_BUILDING_ID
protected static final java.lang.String LOG_BEACONS_FUTURE
protected static final java.lang.String LOG_BEACONS_DONE
protected android.content.Context context
protected java.util.List<java.lang.String> userInput
public InitializeProcess(android.content.Context context,
java.util.List<java.lang.String> userInput)
context - Context used to create the beacon scan clientuserInput - List of strings containing the users inputpublic InitializeProcess.Output call()
call in interface java.util.concurrent.Callable<InitializeProcess.Output>protected BuildingDetector.Output getCurrentBuilding()
protected Building getBuildingData(java.lang.String buildingID)
buildingID - String the id of a buildingprotected DestinationType getDestinationType(UserInputParser inputParser)
inputParser - the UserInputParser containing the input of the userprotected GridNode getNonGenericDestination(DestinationType destinationType, UserInputParser inputParser, DestinationTable destinationTable)
destinationType - DestinationType of the destination being
extractedinputParser - the UserInputParser containing the input of the userdestinationTable - DestinationTable for the buildingprotected GridNode findClosestNodeNaive(java.util.Set<GridNode> nodes,
GridNode start)
nodes - Nodes being compared to the starting nodestart - Starting nodeprotected java.util.List<GridNode> findClosestNode(java.util.Set<GridNode> nodes,
GridNode start,
FloorSequencer pathfinder)
nodes - Nodes being compared to the starting nodestart - Starting nodepathfinder - Pathfinder obejct user to get the path between the
nodesprotected double pathDistance(java.util.List<GridNode> path)
path - Path whose distance is being calculatedprotected double distanceBetweenNodes(GridNode nodeA,
GridNode nodeB)
nodeA - NodenodeB - Node