Skip to content

DataManager.java

Raphaël Lutz edited this page May 22, 2019 · 2 revisions

Static class (id est no instance is created) in charge of managing the input and output data.

Fields

  • probas : will contain the probability matrix of an element to be created at an entrance and goes to an exit. You can more information about it in the Rapport/ folder.
  • inputMatrixEntrances : matrix of the number of vehicle to generate at an entry point for each hour of the day.
  • inputMatrixExits : matrix of the number of vehicle to exit at an exit for each hour of the day.
  • inputMatrixReports : matrix of the min and max value of the transfer scenario (see Rapport/ folder).
  • flowPerExit : matrix of the flow of vehicle in and out of the system.
  • timeSpentTransit : list of the time spend by vehicle on the network (people transiting between France and Geneva only).
  • timeSpentCERN : list of the time spend by the vehicles on the network (CERN employees only).
  • distanceTravelledTransit : list of the distance travelled by the vehicles on the network (people transiting between France and Geneva only).
  • distanceTravelledCERN : list of the distance travelled by the vehicles on the network (CERN employees only).

Methods

  • void initProbas() : it extracts the data from the input entrance/exit text files and register it into the fields. Then it computes the matrix of probability need with the algorithm you can find in the FlowComputation/ folder.
  • void initFlowPerExit() : initializes the flowPerExit field with the input matrices.
  • void initTransfers() : extracts the data from the input reports file and register it into the fields.

  • void applyData(Simulator simulator) : applies the data chosen by the user when the simulation starts. It calls applyDataToRides() and applyRidesToRoads().
  • void applyFlowFromVariables(Ride r) : after applyDataToRides(Simulator simulator) is called, this method apply the flow to the given Ride (applyDataToRides()
  • boolean lastRoadIs(Ride r, String roadName) : return true if the last road of the Ride is roadName, false if not
Clone this wiki locally