planner/src/main/java/Plan.java
public void render(String routeCsv, String assignmentCsv) throws IOException {
        BufferedWriter routeWriter = new BufferedWriter(new FileWriter(routeCsv));
        BufferedWriter assignmentWriter = new BufferedWriter(new FileWriter(assignmentCsv));
        int i = 0;

        for (Bus bus : busList) {
            SourceOrSinkOrAnchor current = bus;

            if (bus.equals("dummy")) continue;

            routeWriter.write("" + i);
            while (current != null) {

		if (!(current instanceof Stop) ||
		    (current instanceof Stop && (((Stop)current).getStudentList().size() > 0)))
		    routeWriter.write("," + current.getNode().getUuid());

                current = current.getNext();
                if (current instanceof Stop) {
                    assignmentWriter.write("" + i + "," + current.getNode().getUuid());
                    for (Student student : ((Stop)current).getStudentList()) {
                        assignmentWriter.write("," + student.getNode().getUuid());
                    }
                    assignmentWriter.write("\n");
                }
            }
            routeWriter.write("\n");
            i++;
        }

        routeWriter.close();
        assignmentWriter.close();
    }
/**
     * Render a plan to CSV files.
     *
     * @author James McClain
     * @param  routeCsv       Routes are stored to a CSV file of this name
     * @param  assignmentCSV  Student stop assignments are stored to a CSV file of this name
     */
Render a plan to CSV files.
@author James McClain
@param  routeCsv       Routes are stored to a CSV file of this name
@param  assignmentCSV  Student stop assignments are stored to a CSV file of this name
Render a plan to CSV files . @author James McClain @param routeCsv Routes are stored to a CSV file of this name @param assignmentCSV Student stop assignments are stored to a CSV file of this name
public void render(String routeCsv, String assignmentCsv) throws IOException {
        BufferedWriter routeWriter = new BufferedWriter(new FileWriter(routeCsv));
        BufferedWriter assignmentWriter = new BufferedWriter(new FileWriter(assignmentCsv));
        int i = 0;
        for (Bus bus : busList) {
            SourceOrSinkOrAnchor current = bus;
            if (bus.equals("dummy")) continue;
            routeWriter.write("" + i);
            while (current != null) {
		if (!(current instanceof Stop) ||
		    (current instanceof Stop && (((Stop)current).getStudentList().size() > 0)))
		    routeWriter.write("," + current.getNode().getUuid());
                current = current.getNext();
                if (current instanceof Stop) {
                    assignmentWriter.write("" + i + "," + current.getNode().getUuid());
                    for (Student student : ((Stop)current).getStudentList()) {
                        assignmentWriter.write("," + student.getNode().getUuid());
                    }
                    assignmentWriter.write("\n");
                }
            }
            routeWriter.write("\n");
            i++;
        }
        routeWriter.close();
        assignmentWriter.close();
    }
public void render ( String routeCsv , String assignmentCsv ) throws IOException { BufferedWriter routeWriter = new BufferedWriter ( new FileWriter ( routeCsv ) ) ; BufferedWriter assignmentWriter = new BufferedWriter ( new FileWriter ( assignmentCsv ) ) ; int i = 0 ; for ( Bus bus : busList ) { SourceOrSinkOrAnchor current = bus ; if ( bus . equals ( "dummy" ) ) continue ; routeWriter . write ( "" + i ) ; while ( current != null ) { if ( ! ( current instanceof Stop ) || ( current instanceof Stop && ( ( ( Stop ) current ) . getStudentList ( ) . size ( ) > 0 ) ) ) routeWriter . write ( "," + current . getNode ( ) . getUuid ( ) ) ; current = current . getNext ( ) ; if ( current instanceof Stop ) { assignmentWriter . write ( "" + i + "," + current . getNode ( ) . getUuid ( ) ) ; for ( Student student : ( ( Stop ) current ) . getStudentList ( ) ) { assignmentWriter . write ( "," + student . getNode ( ) . getUuid ( ) ) ; } assignmentWriter . write ( "\n" ) ; } } routeWriter . write ( "\n" ) ; i ++ ; } routeWriter . close ( ) ; assignmentWriter . close ( ) ; }
Render a plan to CSV files.
Render a plan to CSV files .