@Override protected final void beforeFinishReplanningHook() { Gbl.printMemoryUsage(); }
@Override protected final void beforeFinishReplanningHook() { Gbl.printMemoryUsage() ; }
private void printLog() { // print output each hour if (simTime / hourlyLogTime > 1) { hourlyLogTime = simTime + 3600; log.info("Simulation at " + simTime / 3600 + "[h]; s/r:" + simTime / (System.currentTimeMillis() - simulationStartTime) * 1000); Gbl.printMemoryUsage(); } }
private void printSimLog(final double time) { if (time >= this.infoTime) { // if(true){ this.infoTime += INFO_PERIOD; Date endtime = new Date(); long diffreal = (endtime.getTime() - this.realWorldStarttime .getTime()) / 1000; double diffsim = time - this.simTimer.getSimStartTime(); log.info("SIMULATION (NEW QSim) AT " + Time.writeTime(time) + " : #Veh=" + this.agentCounter.getLiving() + " lost=" + this.agentCounter.getLost() + " simT=" + diffsim + "s realT=" + (diffreal) + "s; (s/r): " + (diffsim / (diffreal + Double.MIN_VALUE))); Gbl.printMemoryUsage(); } }
protected void runExe(final String iterationConfigFile) throws FileNotFoundException, IOException { String cmd = this.executable + " " + iterationConfigFile; log.info("running command: " + cmd); Gbl.printMemoryUsage(); String logfileName = this.controlerIO.getIterationFilename(this.getIterationNumber(), "mobsim.log"); int timeout = this.simConfig.getExternalTimeOut() ; int exitcode = ExeRunner.run(cmd, logfileName, timeout); if (exitcode != 0) { throw new RuntimeException("There was a problem running the external mobsim. exit code: " + exitcode); } }
private QuadTree<ActivityFacility> buildFacQuadTree(String type, TreeMap<Id<ActivityFacility>,ActivityFacility> facilities_of_type) { Gbl.startMeasurement(); log.info(" building " + type + " facility quad tree"); double minx = Double.POSITIVE_INFINITY; double miny = Double.POSITIVE_INFINITY; double maxx = Double.NEGATIVE_INFINITY; double maxy = Double.NEGATIVE_INFINITY; for (final ActivityFacility f : facilities_of_type.values()) { if (f.getCoord().getX() < minx) { minx = f.getCoord().getX(); } if (f.getCoord().getY() < miny) { miny = f.getCoord().getY(); } if (f.getCoord().getX() > maxx) { maxx = f.getCoord().getX(); } if (f.getCoord().getY() > maxy) { maxy = f.getCoord().getY(); } } minx -= 1.0; miny -= 1.0; maxx += 1.0; maxy += 1.0; System.out.println(" xrange(" + minx + "," + maxx + "); yrange(" + miny + "," + maxy + ")"); QuadTree<ActivityFacility> quadtree = new QuadTree<ActivityFacility>(minx, miny, maxx, maxy); for (final ActivityFacility f : facilities_of_type.values()) { quadtree.put(f.getCoord().getX(),f.getCoord().getY(),f); } log.info(" done"); Gbl.printRoundTime(); Gbl.printMemoryUsage(); return quadtree; }