2020-11-09 22:10:31 +01:00
|
|
|
import java.util.*;
|
2020-11-08 01:05:52 +01:00
|
|
|
|
|
|
|
public class MakkahCity {
|
|
|
|
|
2020-11-09 22:10:31 +01:00
|
|
|
private static final ArrayList<Campaign> allCampgains = new ArrayList<>();
|
|
|
|
|
|
|
|
private static final ArrayList<Vehicle> vehiclesList = new ArrayList<>();
|
|
|
|
private static final Route[] stdRoutes = new Route[9];
|
|
|
|
private static final Street[] stdStreet = new Street[8];
|
|
|
|
|
2020-11-08 01:05:52 +01:00
|
|
|
public static void main(String[] args) {
|
|
|
|
|
2020-11-09 22:10:31 +01:00
|
|
|
//Gen Camp
|
2020-11-10 14:45:35 +01:00
|
|
|
generateCamps(District.ALAZIZIYA, getRandom(70, 100));
|
|
|
|
generateCamps(District.ALMANSOOR, getRandom(110, 160));
|
2020-11-09 22:10:31 +01:00
|
|
|
generateCamps(District.ALHIJRA, getRandom(80, 110));
|
2020-11-10 14:45:35 +01:00
|
|
|
|
2020-11-09 22:10:31 +01:00
|
|
|
//Make Streets
|
|
|
|
makeStreets();
|
2020-11-10 14:45:35 +01:00
|
|
|
|
2020-11-09 22:10:31 +01:00
|
|
|
//Make Routes
|
|
|
|
makeRoutes();
|
|
|
|
|
|
|
|
while(!PDate.isEnded()) {
|
|
|
|
PDate.step(Calendar.MINUTE, 1);
|
|
|
|
//TODO: add civil cars in loop itirations.
|
|
|
|
//TODO: Move busses and vehicles.
|
|
|
|
//TODO: Update streets.
|
|
|
|
//TODO: Streets move forward.
|
|
|
|
//TODO: update vehicles on street.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private static int getRandom(int min, int max) {
|
|
|
|
return (int)(Math.random() * (max - min) + min);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void generateCamps(District area, int count) {
|
|
|
|
for (int i = 0; i < count; i++){
|
|
|
|
Campaign camp = new Campaign(area, getRandom(10, 15));
|
|
|
|
allCampgains.add(camp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void makeStreets(){
|
2020-11-10 14:45:35 +01:00
|
|
|
stdStreet[StreetNames.KA_STREET] = new Street(22700,3);
|
|
|
|
stdStreet[StreetNames.FOURTH_HISHWAY] = new Street(24600,4);
|
|
|
|
stdStreet[StreetNames.THIRD_HIGHWAY] = new Street(22000,3);
|
|
|
|
stdStreet[StreetNames.STREET1] = new Street(4000,2);
|
|
|
|
stdStreet[StreetNames.STREET2] = new Street(7000,2);
|
|
|
|
stdStreet[StreetNames.STREET3] = new Street(400,2);
|
|
|
|
stdStreet[StreetNames.STREET4] = new Street(8200,2);
|
|
|
|
stdStreet[StreetNames.STREET5] = new Street(100,2); //TODO: Change numbers
|
2020-11-08 01:05:52 +01:00
|
|
|
}
|
|
|
|
|
2020-11-09 22:10:31 +01:00
|
|
|
private static void makeRoutes() {
|
2020-11-10 14:45:35 +01:00
|
|
|
// stdRoutes [RouteName.mashierToAlMansoor1] = new Route({stdStreet[]}, hotelArea, mashier)
|
|
|
|
|
|
|
|
|
2020-11-09 22:10:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private static void fillBusesToList() {
|
|
|
|
//TODO: add all buses from campaigns to vehiclesList
|
|
|
|
}
|
2020-11-08 01:05:52 +01:00
|
|
|
}
|