-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataLoader.h
More file actions
33 lines (27 loc) · 1.1 KB
/
Copy pathDataLoader.h
File metadata and controls
33 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#ifndef DATALOADER_H
#define DATALOADER_H
#include "common.h"
#include "RouteGraph.h"
#include "BusScheduler.h"
// A static utility class for loading all network and schedule data.
class DataLoader
{
public:
// Stores the fare rate (cost per minute) for each bus.
// This map is populated in loadNetworkData() and read by BookingManager.
// Key: Normalized bus number (e.g., "21g")
// Value: Cost per minute (e.g., 1.5)
static map<string, double> busFareRates;
// Loads the 15-route Chennai network into our graph.
// ALSO loads the fare data into the busFareRates map.
static void loadNetworkData(RouteGraph &graph);
// Loads the daily schedule for all buses into the BusScheduler.
static void loadBusSchedules(BusScheduler &scheduler, RouteGraph &graph);
private:
// Helper function to build a realistic, consistent bus run.
static void scheduleFullRoute(BusScheduler &scheduler, RouteGraph &graph,
string busNum, vector<string> stops,
string startTime, string endTime, int freq);
};
#endif