Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include data export mods #142

Merged
merged 6 commits into from
Jun 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public class Agent extends Subject implements Runnable {

/** The dim. */
private int numbOfInterupts = 0, waycounter = 0, dim = 2;

private int wayMakingSkipped = 0;

/** The distance. */
private double distance;
Expand Down Expand Up @@ -827,16 +829,19 @@ private void followPath() {
while (waymakingAllowed() == false) {
Thread.sleep(simSettings.getThreadSleepTimeDefault());
}


/* way making procedure is skipped */
if (anyoneNearMe()) {
System.out
.println("waymaking skipped. Delay simulated!");
Thread.sleep(AStarHelper.time(
simSettings.getSeatInterferenceProcessTime()));
wayMakingSkipped++;
waitingCompleted = true;
continue;
}


/* way making works as planned */
if (!waitingCompleted) {

for (Passenger pax : otherPassengersInRowBlockingMe) {
Expand Down Expand Up @@ -1327,4 +1332,9 @@ public void remove() {
}
}

public int getWayMakingSkipped() {
return wayMakingSkipped;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -485,4 +485,12 @@ public static AreamapHandler getAreamapHandler() {
public static Map<Integer, Costmap> getUsedCostmaps() {
return costmaps;
}

public static int getNumberWaymakingSkipped() {
int numberSkipped = 0;
for (Agent agent : agentList) {
numberSkipped = numberSkipped + agent.getWayMakingSkipped();
}
return numberSkipped;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,60 +24,6 @@ public class Exporter {
FILE_PATH = System.getProperty("user.home") + "/Documents/"
+ FOLDER_NAME + "/";

// public static boolean generateHeatmapFile(String filename, AreamapHandler
// areamap) {
// try {
//
// // Create a path before creating the file!
// File dir = new File(FILE_PATH);
// dir.mkdir();
//
// FileWriter writer = new FileWriter(FILE_PATH + filename + ".xls");
// for (ArrayList<Node> nodeList : areamap.getAreamap()) {
// for (Node node : nodeList) {
// writer.append("" + node.getNumberOfOccupations());
// writer.append("\t");
// }
// writer.append("\n");
// }
//
// writer.flush();
// writer.close();
// return true;
//
// } catch (FileNotFoundException e) {
// return false;
// } catch (IOException e) {
// return false;
// }
// }

// public static boolean generateInterruptmapFile(String filename,
// AreamapHandler areamap) {
//
// try {
// // Create a path before creating the file!
// File dir = new File(FILE_PATH);
// dir.mkdir();
// FileWriter writer = new FileWriter(FILE_PATH + filename + ".xls");
// for (ArrayList<Node> nodeList : areamap.getAreamap()) {
// for (Node node : nodeList) {
// writer.append("" + node.getNumberOfInterrupts());
// writer.append("\t");
// }
// writer.append("\n");
// }
//
// writer.flush();
// writer.close();
// return true;
//
// } catch (FileNotFoundException e) {
// return false;
// } catch (IOException e) {
// return false;
// }
// }

/**
* Generate distribution file.
Expand All @@ -91,7 +37,7 @@ public class Exporter {
* @param luggage the luggage
* @param pax the pax
*/
static void generateDistributionFile(String sFileName,
public static void generateDistributionFile(String sFileName,
GaussianStorage weight, GaussianStorage height,
GaussianStorage depth, GaussianStorage width, AgeStorage age,
LuggageStorage luggage, int[] pax) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,18 @@ public void addPassenger(Passenger pax) {
}

if (numberOfPassengers[0] > 179) {
Exporter.generateDistributionFile("export", weightStore, heightStore,
/*Exporter.generateDistributionFile("export", weightStore, heightStore,
depthStore, widthStore, ageStore, luggageStore,
numberOfPassengers);
numberOfPassengers)*/;
}
}

public Object[] getStorageData(){
Object[] storageData = {weightStore, heightStore,
depthStore, widthStore, ageStore, luggageStore,
numberOfPassengers};
return storageData;
}

/**
* Gets the store.
Expand Down Expand Up @@ -126,17 +133,17 @@ public AgeStorage getAgeStore() {
* The Enum StoreType.
*/
public enum StoreType {

/** The weight. */
WEIGHT,
/** The height. */
HEIGHT,
/** The width. */
WIDTH,
/** The depth. */
DEPTH,
/** The age. */
AGE
/** The height. */
HEIGHT,
/** The width. */
WIDTH,
/** The depth. */
DEPTH,
/** The age. */
AGE
}

/**
Expand Down
Loading