Skip to content

Commit

Permalink
updated trip-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
JockeTS-BTH committed Jan 18, 2024
1 parent 6e2eee7 commit 88d95f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions simulation/trip-generator.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const helper = require("./utils").helper;
const SQLiter = require("./utils").SQLiter;
const stationHelper = require("./utils").stationHelper;
const SQLiteHelper = require("./utils").SQLiteHelper;

let requestsMade = 0;

// Generate trips for all stations
async function generateTrips() {
const stations = await helper.getAllStations();
const stations = await stationHelper.getStations();

// Open connection to SQLite database
const dbc = SQLiter.getDBConnection();
const dbc = SQLiteHelper.getDBConnection();

for (i = 0; i < stations.length; i++) {
const currentStation = stations[i];
Expand All @@ -29,7 +29,7 @@ async function generateTrips() {
}

// Close connection to SQLite database
SQLiter.closeDBConnection(dbc);
SQLiteHelper.closeDBConnection(dbc);
}

// Generate a single trip
Expand Down
2 changes: 1 addition & 1 deletion simulation/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,4 @@ const publicHelper = {
}
}

module.exports = { publicHelper };
module.exports = { publicHelper, stationHelper, SQLiteHelper };

0 comments on commit 88d95f2

Please sign in to comment.