private double computeObjectiveFucntionFromNetPlan () { return this.currentNetPlan.getVectorLinkCarriedTraffic().zSum () / this.stat_totalOfferedTrafficConstant; }
public String finish(StringBuilder st, double simTime) { if (simulation_outFileNameRoot.getString().equals("")) return null; stat_traceOf_objFun.printToFile(new File(simulation_outFileNameRoot.getString() + "_objFunc.txt")); stat_traceOf_x_te.printToFile(new File(simulation_outFileNameRoot.getString() + "_xte.txt")); stat_traceOf_y_e.printToFile(new File(simulation_outFileNameRoot.getString() + "_ye.txt")); final NetPlan optNetPlan = computeOptimumSolution(); TimeTrace.printToFile(new File(simulation_outFileNameRoot.getString() + "_jom_objFunc.txt"), new double[] { computeObjectiveFunctionFromNetPlan(optNetPlan) }); TimeTrace.printToFile(new File(simulation_outFileNameRoot.getString() + "_jom_xte.txt"), optNetPlan.getMatrixDestination2LinkTrafficCarried()); TimeTrace.printToFile(new File(simulation_outFileNameRoot.getString() + "_jom_ye.txt"), optNetPlan.getVectorLinkCarriedTraffic()); return null; }
System.out.println("np.getLinkCarriedTrafficMap(): " + np.getVectorLinkCarriedTraffic()); throw new RuntimeException ("Bad");
public String finish (StringBuilder st , double simTime) { double [] avTrafficGenerated_d = new double [D]; for (int index_d = 0; index_d < D ; index_d ++) avTrafficGenerated_d[index_d] = stat_accumNumGeneratedPackets_d [index_d] * routing_numTrafficUnitsOfOnePacket.getDouble() / simTime; /* If no output file, return */ if (simulation_outFileNameRoot.getString().equals("")) return null; /* Compute optimum solution and cost */ double optCost = optNetPlan.getVectorLinkCarriedTraffic().zSum() / stat_totalOfferedTrafficConstant; TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_objFunc.txt"), optCost); TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_xp.txt"), optNetPlan.getVectorRouteCarriedTraffic()); TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_ye.txt"), optNetPlan.getVectorLinkCarriedTraffic()); TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_qnd.txt"), optQueueSizes_nd); this.stat_traceOf_queueSizes.printToFile(new File (simulation_outFileNameRoot.getString() + "_qnd.txt")); this.stat_traceOf_objFunction.printToFile(new File (simulation_outFileNameRoot.getString() + "_objFunc.txt")); this.stat_traceOf_ye.printToFile(new File (simulation_outFileNameRoot.getString() + "_ye.txt")); for (Pair<Double,Object> sample : this.stat_traceOf_xp.getList()) { Map<Long,Double> x_p = (Map<Long,Double>) sample.getSecond (); for (long r: this.currentNetPlan.getRouteIds()) if (!x_p.containsKey(r)) x_p.put(r , 0.0); } this.stat_traceOf_xp.printToFile(new File (simulation_outFileNameRoot.getString() + "_xp.txt")); return null; }
public String finish (StringBuilder st , double simTime) { if (simulation_outFileNameRoot.getString().equals("")) return null; this.traceOf_objFunction.printToFile(new File (simulation_outFileNameRoot.getString() + "_objFunc.txt")); this.traceOf_u_e.printToFile(new File (simulation_outFileNameRoot.getString() + "_ue.txt")); this.traceOf_y_e.printToFile(new File (simulation_outFileNameRoot.getString() + "_ye.txt")); this.traceOf_p_e.printToFile(new File (simulation_outFileNameRoot.getString() + "_pe.txt")); this.traceOf_pi_e.printToFile(new File (simulation_outFileNameRoot.getString() + "_pie.txt")); this.traceOf_h_d.printToFile(new File (simulation_outFileNameRoot.getString() + "_hd.txt")); Map<String,String> param = new HashMap<String,String> (algorithmParameters); param.put("solverName", "ipopt"); param.put("solverLibraryName", ""); param.put("maxSolverTimeInSeconds", "-1"); new Offline_cba_wirelessCongControlTransmissionPowerAssignment ().executeAlgorithm(copyInitialNetPlan , param , this.net2planParameters); TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_objFunc.txt") , NetworkPerformanceMetrics.alphaUtility(copyInitialNetPlan.getVectorDemandOfferedTraffic() , cc_fairnessFactor.getDouble())); TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_ue.txt") , copyInitialNetPlan.getVectorLinkCapacity()); TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_ye.txt") , copyInitialNetPlan.getVectorLinkCarriedTraffic()); TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_hd.txt") , copyInitialNetPlan.getVectorDemandCarriedTraffic()); TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_pe.txt") , copyInitialNetPlan.getVectorAttributeValues(copyInitialNetPlan.getLinks () , "p_e")); TimeTrace.printToFile(new File (simulation_outFileNameRoot.getString() + "_jom_pie.txt") , copyInitialNetPlan.getVectorAttributeValues(copyInitialNetPlan.getLinks () , "pi_e")); return null; }
this.stat_traceOf_ye.add(time, this.currentNetPlan.getVectorLinkCarriedTraffic()); this.stat_traceOf_objFunction.add(time, computeObjectiveFucntionFromNetPlan()); final double scaleFactorAccumNumQueuePacketsToAverageQueuedTraffic = this.routing_numTrafficUnitsOfOnePacket.getDouble() / this.routing_statNumSchedSlotBetweenN2PRecomputing.getInt();
this.stat_traceOf_ye.add(0.0, this.currentNetPlan.getVectorLinkCarriedTraffic()); this.stat_traceOf_objFunction.add(0.0, NetworkPerformanceMetrics.alphaUtility(currentNetPlan.getVectorDemandOfferedTraffic() , control_fairnessFactor.getDouble()));
this.stat_traceOf_objFunction = new TimeTrace (); this.stat_traceOf_xp.add(0.0 , netPlanRouteCarriedTrafficMap (this.currentNetPlan)); this.stat_traceOf_ye.add(0.0, this.currentNetPlan.getVectorLinkCarriedTraffic()); this.stat_traceOf_queueSizes.add(0.0, copyOf(this.ctlNumPacketsQueue_nd)); this.stat_traceOf_objFunction.add(0.0, computeObjectiveFucntionFromNetPlan());
this.stat_traceOf_ye.add(time, currentNetPlan.getVectorLinkCarriedTraffic()); this.stat_traceOf_objFunction.add(time, computeObjectiveFunctionFromNetPlan(this.currentNetPlan)); final double scaleFactorAccumNumQueuePacketsToAverageQueuedTraffic = this.routing_numTrafficUnitsOfOnePacket.getDouble() / this.routing_statNumSchedSlotBetweenN2PRecomputing.getInt ();
this.stat_traceOf_maxLinkTraffic.add(t, this.currentNetPlan.getVectorLinkCarriedTraffic().getMaxLocation() [0]);
this.stat_traceOf_hd = new TimeTrace (); this.stat_traceOf_xp.add(0.0 , netPlanRouteCarriedTrafficMap (this.currentNetPlan)); this.stat_traceOf_ye.add(0.0, currentNetPlan.getVectorLinkCarriedTraffic()); this.stat_traceOf_queueSizes.add(0.0, copyOf(this.ctlNumPacketsQueue_nd)); this.stat_traceOf_objFunction.add(0.0, computeObjectiveFunctionFromNetPlan(this.currentNetPlan));
this.stat_traceOf_ye.add(t, this.currentNetPlan.getVectorLinkCarriedTraffic()); this.stat_traceOf_objFunction.add(t, NetworkPerformanceMetrics.alphaUtility(currentNetPlan.getVectorDemandOfferedTraffic() , control_fairnessFactor.getDouble()));
stat_traceOf_objFun.add(time, computeObjectiveFunctionFromNetPlan(this.currentNetPlan)); stat_traceOf_x_te.add(time, this.currentNetPlan.getMatrixDestination2LinkTrafficCarried()); stat_traceOf_y_e.add(time, this.currentNetPlan.getVectorLinkCarriedTraffic());
this.stat_traceOf_ye.add(t, this.currentNetPlan.getVectorLinkCarriedTraffic()); this.stat_traceOf_objFunction.add(t, computeObjectiveFucntionFromNetPlan());
this.stat_traceOf_xp.add(0.0, this.currentNetPlan.getVectorRouteCarriedTraffic()); this.stat_traceOf_pie.add(0.0, this.routing_price_e.copy ()); this.stat_traceOf_ye.add(0.0, this.currentNetPlan.getVectorLinkCarriedTraffic()); this.stat_traceOf_objFunction.add(0.0, computeObjectiveFucntionFromNetPlan());
this.traceOf_y_e.add(t, this.currentNetPlan.getVectorLinkCarriedTraffic()); this.traceOf_p_e.add(t, this.mac_transmissionPower_logu_e.copy ()); this.traceOf_pi_e.add(t, this.cc_price_e.copy ());
this.stat_traceOf_hd.add(0 , this.currentNetPlan.getVectorDemandOfferedTraffic()); this.stat_traceOf_objFunction.add(0 , NetworkPerformanceMetrics.alphaUtility(currentNetPlan.getVectorDemandOfferedTraffic() , control_fairnessFactor.getDouble())); this.stat_traceOf_maxLinkTraffic.add(0.0, this.currentNetPlan.getVectorLinkCarriedTraffic().getMaxLocation() [0]);
this.traceOf_y_e.add(0.0, this.currentNetPlan.getVectorLinkCarriedTraffic()); this.traceOf_p_e.add(0.0, this.mac_transmissionPower_logu_e.copy ()); this.traceOf_pi_e.add(0.0, this.cc_price_e.copy ());