Index: DCWoRMS/trunk/src/simulator/stats/implementation/GSSAccumulatorsStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/GSSAccumulatorsStats.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/GSSAccumulatorsStats.java	(revision 495)
@@ -10,4 +10,5 @@
 	public GSSAccumulator meanQueueLength;
 	public GSSAccumulator meanEnergyUsage;
+	public GSSAccumulator meanAirFlow;
 
 	public GSSAccumulator meanTaskStartTime;
@@ -29,5 +30,6 @@
 		meanReservationLoad = new GSSAccumulator();
 		meanQueueLength = new GSSAccumulator();
-		meanEnergyUsage = new GSSAccumulator();
+		meanEnergyUsage = new GSSAccumulator(); 
+		meanAirFlow = new GSSAccumulator(); 
 
 		meanTaskStartTime = new GSSAccumulator();
Index: DCWoRMS/trunk/src/simulator/stats/implementation/out/StatsSerializer.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/out/StatsSerializer.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/out/StatsSerializer.java	(revision 495)
@@ -4,4 +4,5 @@
 import simulator.stats.implementation.GSSAccumulatorsStats;
 import simulator.stats.implementation.JobStats;
+import simulator.stats.implementation.ResourceAirFlowStats;
 import simulator.stats.implementation.ResourceEnergyStats;
 import simulator.stats.implementation.ResourceStats;
@@ -28,4 +29,5 @@
 	public Object visit(ResourceEnergyStats arg);
 
+	public Object visit(ResourceAirFlowStats arg);
 	
 	public Object visit(GSSAccumulatorsStats arg);
Index: DCWoRMS/trunk/src/simulator/stats/implementation/out/StringSerializer.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/out/StringSerializer.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/out/StringSerializer.java	(revision 495)
@@ -11,4 +11,5 @@
 import simulator.stats.implementation.GSSAccumulatorsStats;
 import simulator.stats.implementation.JobStats;
+import simulator.stats.implementation.ResourceAirFlowStats;
 import simulator.stats.implementation.ResourceEnergyStats;
 import simulator.stats.implementation.ResourceStats;
@@ -258,5 +259,5 @@
 
 	public Object visit(ResourceUsageStats resourceUsageStats) {
-		Map<Long, Integer> resourceUsage = resourceUsageStats.getUsage();
+		Map<Long, Double> resourceUsage = resourceUsageStats.getUsage();
 		
 		int mapSize = resourceUsage.size();
@@ -297,5 +298,5 @@
 			buffer.append(resourceUsageStats.getResourceName());
 			buffer.append(fieldSeparator);
-			Integer value = resourceUsage.get(timestamp);
+			Double value = resourceUsage.get(timestamp);
 			buffer.append(timestamp);
 			buffer.append(fieldSeparator);
@@ -371,4 +372,62 @@
 	}
 
+	public Object visit(ResourceAirFlowStats resourceAirFlowStats) {
+		Map<Long, Double> resourceAirFlow = resourceAirFlowStats.getAirFlow();
+		
+		int mapSize = resourceAirFlow.size();
+		/*
+		 * FIXME:
+		 * Integer.MAX_VALUE = 2147483647. We assume, that each line contains 
+		 * max 30 signs - this gives max 71582788 lines. If resourceUsage map
+		 * contains more elements then we have a problem, because content of
+		 * resourceUsage map will not fit in the buffer.
+		 * This will need further attention in the future.
+		 */
+		int maxSize = (Integer.MAX_VALUE / 30 ) - 1;
+		if(mapSize >= maxSize){
+			log.error("Resource usage data is to long to fit in the buffer.");
+			return null;
+		}
+		
+		int size = 30 * resourceAirFlow.size();
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceAirFlowStats.getUsageType())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceAirFlowStats.getHeaders();
+			for(int i = 0; i < headers.length; i++)
+			{
+				buffer.append(headers[i]);
+				buffer.append(fieldSeparator);
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(size);
+		}
+		
+		
+		for (Long timestamp : resourceAirFlow.keySet()) {
+			
+			buffer.append(resourceAirFlowStats.getResourceName());
+			buffer.append(fieldSeparator);
+			Double value = resourceAirFlow.get(timestamp);
+			buffer.append(timestamp);
+			buffer.append(fieldSeparator);
+			buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+					.format(value));
+			buffer.append(fieldSeparator);
+			buffer.append(System.getProperty("line.separator"));
+
+		}
+		
+		if(resourceAirFlow.size() > 0) {
+			buffer.append("mean: "+resourceAirFlowStats.getMeanUsage() + " sum: " +resourceAirFlowStats.getSumUsage());
+			buffer.append(System.getProperty("line.separator"));	
+		}
+
+		return buffer.toString();
+	}
+
 	public Object visit(GSSAccumulatorsStats accStats) {
 
Index: DCWoRMS/trunk/src/simulator/stats/implementation/out/FormatedStringSerializer.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/out/FormatedStringSerializer.java	(revision 477)
+++ 	(revision )
@@ -1,570 +1,0 @@
-package simulator.stats.implementation.out;
-
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import simulator.DataCenterWorkloadSimulator;
-import simulator.stats.implementation.AccumulatedResourceStats;
-import simulator.stats.implementation.GSSAccumulatorsStats;
-import simulator.stats.implementation.JobStats;
-import simulator.stats.implementation.ResourceEnergyStats;
-import simulator.stats.implementation.ResourceStats;
-import simulator.stats.implementation.ResourceUsageStats;
-import simulator.stats.implementation.TaskStats;
-
-/**
- * 
- * @author Marcin Krystek, Jarek Szymczak
- * 
- *         This serializer needs correct implementation. Now it works as simple
- *         StringSerializer.
- * 
- */
-
-public class FormatedStringSerializer extends AbstractStringSerializer {
-
-	private Log log = LogFactory.getLog(FormatedStringSerializer.class);
-	
-	private String fieldSeparator = "; ";
-
-	public String visit(TaskStats taskStats) {
-
-		StringBuffer buffer = null;
-
-		if(printedHeaders.add("taskStats")) {
-			buffer = new StringBuffer(520);
-			String[] headers = taskStats.getHeaders();
-			if (headers.length == 23) {
-
-				buffer.append(String.format("%5s", headers[0]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%7s", headers[1]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%7s", headers[2]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%14s", headers[3]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%7s", headers[4]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%14s", headers[5]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%15s", headers[6]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%13s", headers[7]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%13s", headers[8]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%13s", headers[9]));
-				buffer.append(fieldSeparator);
-
-				if (this.useExtended) {
-					buffer.append(String.format("%15s", headers[10]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%14s", headers[11]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%14s", headers[12]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%10s", headers[13]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%10s", headers[14]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%9s", headers[15]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%12s", headers[16]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%15s", headers[17]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%9s", headers[18]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%10s", headers[19]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%16s", headers[20]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%17s", headers[21]));
-					buffer.append(fieldSeparator);
-					buffer.append(String.format("%-17s", headers[22]));
-					buffer.append(fieldSeparator);
-				}
-
-			} else {
-				buffer.append(headers.toString());
-			}
-			buffer.append(System.getProperty("line.separator"));
-		} else {
-			buffer = new StringBuffer(260);
-		}
-
-		buffer.append(String.format("%5s", taskStats.getJobID()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%7s", taskStats.getTaskID()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%7s", taskStats.getUserDN()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%14s", taskStats.getResName()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%7d", taskStats.getCpuCnt()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%14d",
-				Double.valueOf(taskStats.getExecStartDate()).longValue()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%15d",
-				Double.valueOf(taskStats.getExecFinishDate()).longValue()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%13d",
-				Double.valueOf(taskStats.getExecEndDate()).longValue()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%13d",
-				Double.valueOf(taskStats.getGB_SubDate()).longValue()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%13d",
-				Double.valueOf(taskStats.getLB_SubDate()).longValue()));
-		buffer.append(fieldSeparator);
-
-		if (this.useExtended) {
-			buffer.append(String.format("%15d",
-					Double.valueOf(taskStats.getCompletionTime()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%14d",
-					Double.valueOf(taskStats.getExecStartTime()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%14d",
-					Double.valueOf(taskStats.getExecutionTime()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%10d",
-					Double.valueOf(taskStats.getReadyTime()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%10d",
-					Double.valueOf(taskStats.getStartTime()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%9d",
-					Double.valueOf(taskStats.getFlowTime()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%12d",
-					Double.valueOf(taskStats.getWaitingTime()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%15d",
-					Double.valueOf(taskStats.getGQ_WaitingTime()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%9d",
-					Double.valueOf(taskStats.getLateness()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%10d",
-					Double.valueOf(taskStats.getTardiness()).longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%16d",
-					Double.valueOf(taskStats.getReservationStartDate())
-							.longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%17d",
-					Double.valueOf(taskStats.getReservationFinishDate())
-							.longValue()));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%-17s", taskStats.getProcessorsName()));
-			buffer.append(fieldSeparator);
-
-		}
-
-		return buffer.toString();
-	}
-
-	public String visit(JobStats jobStats) {
-
-		StringBuffer buffer = null;
-
-		if(printedHeaders.add("jobStats")) {
-			buffer = new StringBuffer(200);
-			String[] headers = jobStats.getHeaders();
-			if (headers.length == 10) {
-
-				buffer.append(String.format("%5s", headers[0]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%23s", headers[1]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%22s", headers[2]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%18s", headers[3]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%17s", headers[4]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%20s", headers[5]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%23s", headers[6]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%9s", headers[7]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%10s", headers[8]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%9s", headers[9]));
-				buffer.append(fieldSeparator);
-
-			} else {
-				buffer.append(headers.toString());
-			}
-			buffer.append(System.getProperty("line.separator"));
-		} else {
-			buffer = new StringBuffer(100);
-		}
-
-		buffer.append(String.format("%5s", jobStats.getJobID()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%23s", defaultNumberFormat.format(jobStats
-				.getMeanTaskCompletionTime().getMean())));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%22s", defaultNumberFormat.format(jobStats
-				.getMeanTaskExecutionTime().getMean())));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%18s", defaultNumberFormat.format(jobStats
-				.getMeanTaskStartTime().getMean())));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%17s", defaultNumberFormat.format(jobStats
-				.getMeanTaskFlowTime().getMean())));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%20s", defaultNumberFormat.format(jobStats
-				.getMeanTaskWaitingTime().getMean())));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%23s", defaultNumberFormat.format(jobStats
-				.getMeanTaskGQ_WaitingTime().getMean())));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%9s",
-				defaultNumberFormat.format(jobStats.getTardiness().getMean())));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%10s",
-				defaultNumberFormat.format(jobStats.getLateness().getMean())));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%9s",
-				defaultNumberFormat.format(jobStats.getMakespan().getMean())));
-		buffer.append(fieldSeparator);
-
-		return buffer.toString();
-	}
-
-	public String visit(ResourceStats resourceStats) {
-
-		StringBuffer buffer = null;
-
-		if(printedHeaders.add("resourceStats")) {
-			buffer = new StringBuffer(600);
-			String[] headers = resourceStats.getHeaders();
-			if (headers.length == 7) {
-
-				buffer.append(String.format("%-20s", headers[0]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%6s", headers[1]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%3s", headers[2]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%9s", headers[3]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%12s", headers[4]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%-120s", headers[5]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%-120s", headers[6]));
-				buffer.append(fieldSeparator);
-			} else {
-				buffer.append(headers.toString());
-			}
-			buffer.append(System.getProperty("line.separator"));
-		} else {
-			buffer = new StringBuffer(300);
-		}
-
-		buffer.append(String.format("%-20s", resourceStats.getResourceName()));
-		buffer.append(fieldSeparator);
-
-		buffer.append(String.format("%6d", resourceStats.getMemory()));
-		buffer.append(fieldSeparator);
-
-		buffer.append(String.format("%3d", resourceStats.getCpucnt()));
-		buffer.append(fieldSeparator);
-
-		buffer.append(String.format("%9d", resourceStats.getCpuspeed()));
-		buffer.append(fieldSeparator);
-
-		buffer.append(String.format("%-12s",
-				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
-						.format(resourceStats.getQueueLength())));
-		buffer.append(fieldSeparator);
-
-		StringBuffer tempBuffer = new StringBuffer();
-		
-		/*Map<String, Double> processorsLoad = resourceStats.getProcessorsLoad();
-		for (String processorName : processorsLoad.keySet()) {
-
-			Double load = processorsLoad.get(processorName);
-			tempBuffer.append(String.format("%-12s", processorName));
-			tempBuffer.append(" ");
-			tempBuffer.append(String.format("%-5s", GridSchedulingSimulator.DFAULT_NUMBER_FORMAT
-					.format(load)));
-			tempBuffer.append(": ");
-
-		}*/
-		
-		buffer.append(String.format("%-120s", tempBuffer.toString()));
-		buffer.append(fieldSeparator);
-		
-		tempBuffer = new StringBuffer();
-		
-		Map<String, Double> processorsReservationLoad = resourceStats
-				.getProcessorsReservationLoad();
-		for (String processorName : processorsReservationLoad.keySet()) {
-
-			Double reservationLoad = processorsReservationLoad
-					.get(processorName);
-			tempBuffer.append(String.format("%-12s", processorName));
-			tempBuffer.append(" ");
-			tempBuffer.append(String.format("%-5s", DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
-					.format(reservationLoad)));
-			tempBuffer.append(": ");
-		}
-		buffer.append(String.format("%-120s", tempBuffer.toString()));
-		buffer.append(fieldSeparator);
-		return buffer.toString();
-	}
-
-	public String visit(AccumulatedResourceStats accResStats) {
-
-		StringBuffer buffer = null;
-
-		if(printedHeaders.add("accResStats")) {
-			buffer = new StringBuffer(340);
-			String[] headers = accResStats.getHeaders();
-			if (headers.length == 9) {
-
-				buffer.append(String.format("%-27s", headers[0]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%-27s", headers[1]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[2]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[3]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[4]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[5]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[6]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[7]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[8]));
-				buffer.append(fieldSeparator);
-			} else {
-				buffer.append(headers.toString());
-			}
-			buffer.append(System.getProperty("line.separator"));
-		} else {
-			buffer = new StringBuffer(170);
-		}
-
-		buffer.append(String.format("%-27s", accResStats.getResourceName()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%-27s", "load"));
-		buffer.append(accResStats.getResourceLoad().toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-27s", accResStats.getResourceName()));
-		buffer.append(fieldSeparator);
-		buffer.append(String.format("%-27s", "reservationload"));
-		buffer.append(accResStats.getResourceReservationLoad()
-				.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-
-		return buffer.toString();
-	}
-
-	public Object visit(ResourceUsageStats resourceUsageStats) {
-		Map<Long, Integer> resourceUsage = resourceUsageStats.getUsage();
-
-		int mapSize = resourceUsage.size();
-		/*
-		 * FIXME: Integer.MAX_VALUE = 2147483647. We assume, that each line
-		 * contains max 30 signs - this gives max 71582788 lines. If
-		 * resourceUsage map contains more elements then we have a problem,
-		 * because content of resourceUsage map will not fit in the buffer. This
-		 * will need further attention in the future.
-		 */
-		int maxSize = (Integer.MAX_VALUE / 30) - 1;
-		if (mapSize >= maxSize) {
-			log.error("Resource usage data is to long to fit in the buffer.");
-			return null;
-		}
-
-		int size = 30 * resourceUsage.size();
-
-		StringBuffer buffer = null;
-
-		if(printedHeaders.add(resourceUsageStats.getResourceType().getName())) {
-			buffer = new StringBuffer(size + 42);
-			String[] headers = resourceUsageStats.getHeaders();
-			if (headers.length == 3) {
-
-				buffer.append(String.format("%-20s", headers[0]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%15s", headers[1]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%5s", headers[2]));
-				buffer.append(fieldSeparator);
-
-			} else {
-				buffer.append(headers.toString());
-			}
-			buffer.append(System.getProperty("line.separator"));
-		} else {
-			buffer = new StringBuffer(size);
-		}
-
-		for (Long timestamp : resourceUsage.keySet()) {
-
-			buffer.append(String.format("%-20s",
-					resourceUsageStats.getResourceName()));
-			buffer.append(fieldSeparator);
-			Integer value = resourceUsage.get(timestamp);
-			buffer.append(String.format("%15d", timestamp));
-			buffer.append(fieldSeparator);
-			buffer.append(String.format("%5s",
-					DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(value)));
-			buffer.append(fieldSeparator);
-			buffer.append(System.getProperty("line.separator"));
-
-		}
-
-		return buffer.toString();
-	}
-
-	
-	public Object visit(GSSAccumulatorsStats accStats) {
-
-		StringBuffer buffer = null;
-
-		if(printedHeaders.add("accStats")) {
-			buffer = new StringBuffer(2800);
-			String[] headers = accStats.getHeaders();
-			if (headers.length == 8) {
-
-				buffer.append(String.format("%-26s", headers[0]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[1]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[2]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[3]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[4]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[5]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[6]));
-				buffer.append(fieldSeparator);
-				buffer.append(String.format("%16s", headers[7]));
-				buffer.append(fieldSeparator);
-			} else {
-				buffer.append(headers.toString());
-			}
-			buffer.append(System.getProperty("line.separator"));
-		} else {
-			buffer = new StringBuffer(1400);
-		}
-
-		buffer.append(String.format("%-26s", "Delayed tasks"));
-		buffer.append(accStats.delayedTasks.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Failed requests (tasks)"));
-		buffer.append(accStats.failedRequests.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Makespan"));
-		buffer.append(accStats.makespan.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Resources queue length"));
-		buffer.append(accStats.meanQueueLength.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Resources total load"));
-		buffer.append(accStats.meanTotalLoad.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Resources reservation load"));
-		buffer.append(accStats.meanReservationLoad.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Energy usage"));
-		buffer.append(accStats.meanEnergyUsage.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Task completion time"));
-		buffer.append(accStats.meanTaskCompletionTime.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Task execution time"));
-		buffer.append(accStats.meanTaskExecutionTime.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Task start time"));
-		buffer.append(accStats.meanTaskStartTime.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Task flow time"));
-		buffer.append(accStats.meanTaskFlowTime.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Task waiting time"));
-		buffer.append(accStats.meanTaskWaitingTime.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Task lateness"));
-		buffer.append(accStats.lateness.toFormatedString());
-		buffer.append(System.getProperty("line.separator"));
-		buffer.append(String.format("%-26s", "Task tardiness"));
-		buffer.append(accStats.tardiness.toFormatedString());
-
-		return buffer.toString();
-
-	}
-
-	public Object visit(ResourceEnergyStats resourceEnergyStats) {
-		Map<Long, Double> resourceEnergy = resourceEnergyStats.getEnergy();
-		
-		int mapSize = resourceEnergy.size();
-		/*
-		 * FIXME:
-		 * Integer.MAX_VALUE = 2147483647. We assume, that each line contains 
-		 * max 30 signs - this gives max 71582788 lines. If resourceUsage map
-		 * contains more elements then we have a problem, because content of
-		 * resourceUsage map will not fit in the buffer.
-		 * This will need further attention in the future.
-		 */
-		int maxSize = (Integer.MAX_VALUE / 30 ) - 1;
-		if(mapSize >= maxSize){
-			log.error("Resource usage data is to long to fit in the buffer.");
-			return null;
-		}
-		
-		int size = 30 * resourceEnergy.size();
-		
-		StringBuffer buffer = null;
-
-		if(printedHeaders.add(resourceEnergyStats.getUsageType())) {
-			buffer = new StringBuffer(size + 42);
-			String[] headers = resourceEnergyStats.getHeaders();
-			for(int i = 0; i < headers.length; i++)
-			{
-				buffer.append(headers[i]);
-				buffer.append(fieldSeparator);
-			}
-			buffer.append(System.getProperty("line.separator"));
-		} else {
-			buffer = new StringBuffer(size);
-		}
-		
-		
-		for (Long timestamp : resourceEnergy.keySet()) {
-			
-			buffer.append(resourceEnergyStats.getResourceName());
-			buffer.append(fieldSeparator);
-			Double value = resourceEnergy.get(timestamp);
-			buffer.append(timestamp);
-			buffer.append(fieldSeparator);
-			buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
-					.format(value));
-			buffer.append(fieldSeparator);
-			buffer.append(System.getProperty("line.separator"));
-
-		}
-		buffer.append("mean: "+resourceEnergyStats.getMeanUsage() + " sum: " +resourceEnergyStats.getSumUsage());
-		buffer.append(System.getProperty("line.separator"));
-
-		return buffer.toString();
-	}
-}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 494)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 495)
@@ -62,4 +62,5 @@
 import schedframe.resources.computing.extensions.ExtensionType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirFlowValue;
 import schedframe.resources.computing.profiles.energy.power.PowerUsage;
 import schedframe.resources.units.PEUnit;
@@ -81,5 +82,4 @@
 import simulator.stats.SimulationStatistics;
 import simulator.stats.implementation.out.AbstractStringSerializer;
-import simulator.stats.implementation.out.FormatedStringSerializer;
 import simulator.stats.implementation.out.StringSerializer;
 import csiro.mit.utils.jfreechart.timetablechart.TimetableChartFactory;
@@ -98,6 +98,5 @@
 	protected static float ALPHA = 0.5f;
 	protected static int GANTT_WIDTH = 1200;
-
-	//protected static final int BITS = 8;
+	
 	protected static final int MILLI_SEC = 1000;
 
@@ -106,6 +105,7 @@
 
 	protected static final String SIMULATION_STATISTICS_OUTPUT_FILE_NAME = "Simulation.txt";
-	protected static final String ENERGYUSAGE_STATISTICS_OUTPUT_FILE_NAME = "Energy.txt";
-	protected static final String RESOURCEUSAGE_STATISTICS_OUTPUT_FILE_NAME = "ResourceUtilization.txt";
+	protected static final String RESOURCEUTILIZATION_STATISTICS_OUTPUT_FILE_NAME = "ResourceUtilization.txt";
+	protected static final String ENERGYUSAGE_STATISTICS_OUTPUT_FILE_NAME = "EnergyUsage.txt";
+	protected static final String AIRFLOW_STATISTICS_OUTPUT_FILE_NAME = "AirThroughput.txt";
 
 	protected static final String DIAGRAMS_FILE_NAME_PREFIX = "Chart_";
@@ -123,5 +123,5 @@
 	protected Map<String, GSSAccumulator> statsData;
 	
-	private GenericUser users;
+	protected GenericUser users;
 	protected ResourceController resourceController;
 	protected boolean generateDiagrams = true;
@@ -132,5 +132,6 @@
 	//RESOURCES
 	protected Timetable ganttDiagramPeTimetable;
-	protected Map<ResourceType, List<XYDataset>> resourceEnergyDiagrams;
+	protected Map<ResourceType, List<XYDataset>> resourcePowerUsageDiagrams;
+	protected Map<ResourceType, List<XYDataset>> resourceAirFlowDiagrams;
 	protected Map<ResourceType, List<XYDataset>> resourceLoadDiagrams;
 	protected Map<String,List<ResStat>> basicResStats;
@@ -161,11 +162,9 @@
 		this.outputFolderName = outputFolderName;
 
-
 		this.serializer = new StringSerializer();
-
 		this.serializer.setDefaultNumberFormat(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT);
 
 		this.resourceController = resourceController;
-		jr = new JobRegistryImpl("");
+		this.jr = new JobRegistryImpl("");
 		init();
 	}
@@ -174,5 +173,4 @@
 
 		this.startSimulationTime = DateTimeUtilsExt.getOffsetTime().getTimeInMillis();
-
 		this.endSimulationTime = DateTimeUtilsExt.currentTimeMillis();
 
@@ -235,7 +233,4 @@
 	private void gatherResourceStatistics() {
 		
-		
-		//TEMPORARY CONFIGURATION SECTION
-		
 		HashMap<String, List<Stats>> type_stats = new HashMap<String, List<Stats>>();
 		
@@ -248,13 +243,16 @@
 			if(ArrayUtils.contains(configuration.resForEnergyChart, resourceName))
 				cStats.add(Stats.chartEnergy);
+			cStats.add(Stats.textAirFlow);
+			if(ArrayUtils.contains(configuration.resForAirFlowChart, resourceName))
+				cStats.add(Stats.chartAirFlow);
 			type_stats.put(resourceName, cStats);
 		}		
 		
 		peGanttMap = new HashMap<String, TimetableEventSource>();
-		taskGanttMap = new HashMap<String, TimetableEventGroup>();
-		
+		taskGanttMap = new HashMap<String, TimetableEventGroup>();		
 		
 		resourceLoadDiagrams = new HashMap<ResourceType, List<XYDataset>>();
-		resourceEnergyDiagrams = new HashMap<ResourceType, List<XYDataset>>();
+		resourcePowerUsageDiagrams = new HashMap<ResourceType, List<XYDataset>>();
+		resourceAirFlowDiagrams = new HashMap<ResourceType, List<XYDataset>>();
 		
 		ganttDiagramPeTimetable = new Timetable(new FixedMillisecond(
@@ -265,5 +263,5 @@
 			File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX
 					+ simulationIdentifier + "_"
-					+ RESOURCEUSAGE_STATISTICS_OUTPUT_FILE_NAME);
+					+ RESOURCEUTILIZATION_STATISTICS_OUTPUT_FILE_NAME);
 			resourceLoadStatsFile = new PrintStream(new FileOutputStream(file));
 		} catch (IOException e) {
@@ -280,5 +278,15 @@
 			energyStatsFile = null;
 		}
-		JobRegistry jr = new JobRegistryImpl("stats");
+		
+		PrintStream airFlowStatsFile = null;
+		try {
+			File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX
+					+ simulationIdentifier + "_"
+					+ AIRFLOW_STATISTICS_OUTPUT_FILE_NAME);
+			airFlowStatsFile = new PrintStream(new FileOutputStream(file));
+		} catch (IOException e) {
+			airFlowStatsFile = null;
+		}
+
 		basicResStats = gatherPEStats(jr.getExecutableTasks());
 		peStatsPostProcessing(basicResStats);
@@ -291,20 +299,17 @@
 		for(String resourceName: resourceController.getComputingResourceLayers()){
 			List<ComputingResource> resources = null;
-			try {
-				resources = new ArrayList<ComputingResource>();
-				for(ComputingResource compRes: resourceController.getComputingResources() ){
-					resources.addAll(compRes.getDescendantsByType(new UserResourceType(resourceName)));
-				}
-				if(resourceController.getComputingResources().get(0).getType().getName().equals(resourceName))
-					resources.addAll(resourceController.getComputingResources());
-			} catch (Exception e) {
-				continue;
-			}
+
+			resources = new ArrayList<ComputingResource>();
+			for(ComputingResource compRes: resourceController.getComputingResources() ){
+				resources.addAll(compRes.getDescendantsByType(new UserResourceType(resourceName)));
+			}
+			if(resourceController.getComputingResources().get(0).getType().getName().equals(resourceName))
+				resources.addAll(resourceController.getComputingResources());
+		
 			if(type_stats.containsKey(resourceName)){
-				Map<String, GSSAccumulator> energyCategoryStats = new TreeMap<String, GSSAccumulator>();
-				Map<String, GSSAccumulator> loadCategoryStats = new TreeMap<String, GSSAccumulator>();
 				for(ComputingResource resource: resources){
 					ResourceUsageStats resourceUsage = null;
 					ResourceEnergyStats energyUsage = null;
+					ResourceAirFlowStats airFlow = null;
 					if(type_stats.get(resourceName).contains(Stats.textLoad)){
 						resourceUsage = gatherResourceLoadStats(resource, basicResStats);
@@ -358,67 +363,41 @@
 					}
 					
-					/*if(resType == ResourceType.ComputingNode){
-						ComputingNode compNode = (ComputingNode) resource;
-						if(energyCategoryStats.containsKey(resType+"#"+compNode.getCategory().getName())){
-							GSSAccumulator acc = energyCategoryStats.get(resType+"#"+compNode.getCategory().getName());
-							acc.add(energyUsage.meanUsage);
-							energyCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
-						} else{
-							GSSAccumulator acc = new GSSAccumulator();
-							acc.add(energyUsage.meanUsage);
-							energyCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+					if(type_stats.get(resourceName).contains(Stats.textAirFlow)){
+						airFlow = gatherResourceAirFlowStats(resource);
+						airFlow.setMeanUsage(calculateAirFlowLoad(airFlow));
+						airFlow.setSumUsage(airFlow.getMeanUsage() * (endSimulationTime - startSimulationTime) / (3600 * MILLI_SEC));
+						
+						EnergyExtension een = (EnergyExtension)(resource.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION));
+						if(resourceController.getComputingResources().contains(resource)) {
+							if( een != null /*&& een.getPp() != null*/ ){
+								accStats.meanAirFlow.add(airFlow.meanValue);
+							}
+
+						} else if( een != null && een.getAirFlowProfile() != null ){
+							ComputingResource parent = resource.getParent();
+							een = (EnergyExtension)(parent.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION));
+							boolean top = true;
+							while(parent != null){
+								if(een != null &&  een.getAirFlowProfile() != null) {
+									top = false;
+									break;
+								}
+								parent = parent.getParent();
+							}
+							if(top == true){
+								accStats.meanAirFlow.add(airFlow.meanValue);
+							}
 						}
-						
-						if(loadCategoryStats.containsKey(resType+"#"+compNode.getCategory().getName())){
-							GSSAccumulator acc = loadCategoryStats.get(resType+"#"+compNode.getCategory().getName());
-							acc.add(resourceUsage.meanUsage);
-							loadCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
-						} else{
-							GSSAccumulator acc = new GSSAccumulator();
-							acc.add(resourceUsage.meanUsage);
-							loadCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+						if (airFlowStatsFile != null) {
+							Object txt = airFlow.serialize(serializer);
+							airFlowStatsFile.println(txt);
 						}
-					} else if(resType == ResourceType.Processor){
-						Processor proc = (Processor)resource;
-						if(energyCategoryStats.containsKey(resType+"#"+proc.getComputingNode().getCategory().getName())){
-							GSSAccumulator acc = energyCategoryStats.get(resType+"#"+proc.getComputingNode().getCategory().getName());
-							acc.add(energyUsage.meanUsage);
-							energyCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
-						} else{
-							GSSAccumulator acc = new GSSAccumulator();
-							acc.add(energyUsage.meanUsage);
-							energyCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
+					}
+					if(type_stats.get(resourceName).contains(Stats.chartAirFlow)){
+
+						if (configuration.creatediagrams_airflow) {
+							createResourceAirFlowGanttDiagram(airFlow);
 						}
-						
-						if(loadCategoryStats.containsKey(resType+"#"+proc.getComputingNode().getCategory().getName())){
-							GSSAccumulator acc = loadCategoryStats.get(resType+"#"+proc.getComputingNode().getCategory().getName());
-							acc.add(resourceUsage.meanUsage);
-							loadCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
-						} else{
-							GSSAccumulator acc = new GSSAccumulator();
-							acc.add(resourceUsage.meanUsage);
-							loadCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
-						}
-					}*/
-				}
-				
-				if(energyCategoryStats.size() > 0)
-				{
-					energyStatsFile.println("\n=========BY CATEGORY===========");
-					for(String key: energyCategoryStats.keySet()){
-						GSSAccumulator acc = energyCategoryStats.get(key);
-						energyStatsFile.println(key + "- mean: "  + acc.getMean()+ " sum: " +acc.getMean() * (endSimulationTime-startSimulationTime) / (3600 * MILLI_SEC) * acc.getCount());
 					}
-					energyStatsFile.println("\n\n");
-				}
-				
-				if(loadCategoryStats.size() > 0)
-				{
-					resourceLoadStatsFile.println("\n=========BY CATEGORY===========");
-					for(String key: loadCategoryStats.keySet()){
-						GSSAccumulator acc = loadCategoryStats.get(key);
-						resourceLoadStatsFile.println(key + "- mean: "  + acc.getMean());
-					}
-					resourceLoadStatsFile.println("\n\n");
 				}
 			}
@@ -427,4 +406,7 @@
 		saveResourceGanttDiagrams();
 		createAccumulatedResourceSimulationStatistic();
+		if (airFlowStatsFile != null) {
+			airFlowStatsFile.close();
+		}
 		if (energyStatsFile != null) {
 			energyStatsFile.close();
@@ -472,10 +454,9 @@
 		}
 	}
+	
 	private Map<String, List<ResStat>> gatherPEStats( ExecutablesList executables) {
-
 		
 		Map<String, List<ResStat>> basicResStats = new TreeMap<String, List<ResStat>>(new MapPEIdComparator());
-		//Map<Integer, Map<String, Object>> history
-		
+
 		for (ExecTask execTask:executables) {
 			Executable exec = (Executable) execTask;
@@ -485,5 +466,5 @@
 			ResourceUnit resUnit = res.get(StandardResourceUnitName.PE);
 			//ProcessingElements pes = (ProcessingElements) resUnit ;
-			if(resUnit instanceof ProcessingElements ){
+			if(resUnit instanceof ProcessingElements){
 				ProcessingElements pes = (ProcessingElements) resUnit;
 				for(ComputingResource pe: pes){
@@ -491,5 +472,4 @@
 					long startDate = Double.valueOf(exec.getExecStartTime()).longValue() * MILLI_SEC;
 					long endDate = Double.valueOf(exec.getFinishTime()).longValue() * MILLI_SEC;
-
 
 					String uniqueTaskID = execTask.getJobId() + "_" + execTask.getId();
@@ -525,7 +505,9 @@
 	private ResourceUsageStats gatherResourceLoadStats(ComputingResource resource, Map<String,List<ResStat>> basicStats) {
 		ResourceUsageStats usageStats = new ResourceUsageStats(resource.getName(), resource.getType(), "resourceLoadStats");
+		int cnt =0;
 		for(String resName: basicStats.keySet()){
 			try {
 				if(resource.getDescendantByName(resName) != null || resource.getName().compareTo(resName) == 0){
+					cnt++;
 					createResourceLoadData(usageStats, basicStats.get(resName));
 				}
@@ -535,10 +517,15 @@
 			}
 		}
+		for(Long key: usageStats.getUsage().keySet()){
+			Double value = usageStats.getUsage().get(key)/cnt;
+			usageStats.getUsage().put(key, value);
+		}
+
 		return usageStats;
 	}
 	
-	private TreeMap<Long, Integer> createResourceLoadData(ResourceUsageStats usageStats, List<ResStat> resStats) {
-
-		TreeMap<Long, Integer> ganttData = (TreeMap)usageStats.getUsage();
+	private TreeMap<Long, Double> createResourceLoadData(ResourceUsageStats usageStats, List<ResStat> resStats) {
+
+		TreeMap<Long, Double> ganttData = (TreeMap<Long, Double>)usageStats.getUsage();
 		for (ResStat resStat : resStats) {
 			
@@ -546,38 +533,39 @@
 			long end_time = resStat.getEndDate();
 			if (end_time > start_time) {
-				Integer end = ganttData.get(end_time);
+				Double end = ganttData.get(end_time);
 				if (end == null) {
-					ganttData.put(end_time, 0);
+					ganttData.put(end_time, 0.0);
 					Long left = getLeftKey(ganttData, end_time);
 					if (left != null) {
-						Integer leftValue = ganttData.get(left);
+						Double leftValue = ganttData.get(left);
 						ganttData.put(end_time, leftValue);
 					}
 				}
 
-				Integer start = ganttData.get(start_time);
+				Double start = ganttData.get(start_time);
 				if (start == null) {
-					ganttData.put(start_time, 0);
+					ganttData.put(start_time, 0.0);
 					Long left = getLeftKey(ganttData, start_time);
 					if (left != null) {
-						Integer leftValue = ganttData.get(left);
+						Double leftValue = ganttData.get(left);
 						ganttData.put(start_time, leftValue);
 					}
 				}
 
-				SortedMap<Long, Integer> sm = ganttData.subMap(start_time,
+				SortedMap<Long, Double> sm = ganttData.subMap(start_time,
 						end_time);
 				for (Long key : sm.keySet()) {
-					Integer keyVal = ganttData.get(key);
+					Double keyVal = ganttData.get(key);
 					ganttData.put(key, keyVal + 1);
 				}
 			}
 		}
+
 		return ganttData;
 	}
 
-	private Long getLeftKey(TreeMap<Long, Integer> ganttData, Long toKey) {
-
-		SortedMap<Long, Integer> sm = ganttData.headMap(toKey);
+	private Long getLeftKey(TreeMap<Long, Double> ganttData, Long toKey) {
+
+		SortedMap<Long, Double> sm = ganttData.headMap(toKey);
 		if (sm.isEmpty()) {
 			return null;
@@ -621,14 +609,46 @@
 	}
 	
-	private void createResourceEnergyGanttDiagram(ResourceEnergyStats energyUsage) {
-
-		XYDataset dataset = createResourceEnergyGanttDataSet(energyUsage,
+	
+	private ResourceAirFlowStats gatherResourceAirFlowStats(ComputingResource resource) {
+
+		ResourceAirFlowStats resAirFlow = new ResourceAirFlowStats(resource.getName(), resource.getType(), "resourceAirFlowStats");
+		Map<Long, Double> airFlow = resAirFlow.getAirFlow();
+		
+		ExtensionList extensionList = resource.getExtensionList();
+		if(extensionList != null){
+			for (Extension extension : extensionList) {
+				if (extension.getType() == ExtensionType.ENERGY_EXTENSION) {
+					EnergyExtension ee = (EnergyExtension)extension;
+					if(ee.getAirFlowProfile() == null)
+						break;
+					List<AirFlowValue> airFlowHistory = ee.getAirFlowProfile().getAirThroughputHistory();
+					if(airFlowHistory.size() == 0)
+						break;
+					long lastTime = DateTimeUtilsExt.getOffsetTime().getTimeInMillis();
+					long endSimulationTime = DateTimeUtilsExt.currentTimeMillis();
+					double lastAirFlow = 0;
+					airFlowHistory.add(new AirFlowValue(endSimulationTime, ee.getAirFlowProfile().getAirThroughputHistory().get(ee.getAirFlowProfile().getAirThroughputHistory().size()-1).getValue()));
+					for(AirFlowValue af:airFlowHistory){
+						airFlow.put(af.getTimestamp(), af.getValue());
+
+						lastAirFlow = af.getValue();
+						lastTime = af.getTimestamp();
+					}
+				}
+			}
+		}
+		return resAirFlow;
+	}
+	
+	private void createResourceEnergyGanttDiagram(ResourceEnergyStats powerUsage) {
+
+		XYDataset dataset = createResourceEnergyGanttDataSet(powerUsage,
 				startSimulationTime, endSimulationTime);
 		
-		List<XYDataset> energyDiagram = resourceEnergyDiagrams.get(energyUsage.getResourceType());
+		List<XYDataset> energyDiagram = resourcePowerUsageDiagrams.get(powerUsage.getResourceType());
 		if(energyDiagram == null){
 			energyDiagram = new ArrayList<XYDataset>();
 			energyDiagram.add(dataset);
-			resourceEnergyDiagrams.put(energyUsage.getResourceType(), energyDiagram);
+			resourcePowerUsageDiagrams.put(powerUsage.getResourceType(), energyDiagram);
 		} else {
 			energyDiagram.add(dataset);
@@ -637,4 +657,20 @@
 	}
 
+	private void createResourceAirFlowGanttDiagram(ResourceAirFlowStats airFlow) {
+
+		XYDataset dataset = createResourceAirFlowGanttDataSet(airFlow,
+				startSimulationTime, endSimulationTime);
+		
+		List<XYDataset> airFlowDiagram = resourceAirFlowDiagrams.get(airFlow.getResourceType());
+		if(airFlowDiagram == null){
+			airFlowDiagram = new ArrayList<XYDataset>();
+			airFlowDiagram.add(dataset);
+			resourceAirFlowDiagrams.put(airFlow.getResourceType(), airFlowDiagram);
+		} else {
+			airFlowDiagram.add(dataset);
+		}
+
+	}
+	
 	private XYDataset createResourceEnergyGanttDataSet(
 			ResourceEnergyStats energyUsage, long start, long end) {
@@ -665,4 +701,30 @@
 	}
 
+	private XYDataset createResourceAirFlowGanttDataSet(
+			ResourceAirFlowStats airFlowStats, long start, long end) {
+
+		TreeMap<Long, Double> ganttdata = createResourceAirFlowGanttData(airFlowStats);
+		XYSeriesCollection dataset = new XYSeriesCollection();
+		XYSeries data = new XYSeries(airFlowStats.getResourceName(), false, true);
+		//data.add(start, 0);
+		for (Long key : ganttdata.keySet()) {
+			Double val = ganttdata.get(key);
+			data.add(key, val);
+		}
+		data.add(end, 0);
+		dataset.addSeries(data);
+		return dataset;
+	}
+
+	private TreeMap<Long, Double> createResourceAirFlowGanttData(
+			ResourceAirFlowStats airFlowStats) {
+
+		Map<Long, Double> airFlow = airFlowStats.getAirFlow();
+		TreeMap<Long, Double> ganttData = new TreeMap<Long, Double>();
+		for (Long afKey : airFlow.keySet()) {
+			ganttData.put(afKey, airFlow.get(afKey));
+		}
+		return ganttData;
+	}
 
 	private boolean saveResourceGanttDiagrams() {
@@ -670,4 +732,5 @@
 		JFreeChart peDiagram = null;
 		JFreeChart resourceEnergyDiagram = null;
+		JFreeChart resourceAirFlowDiagram = null;
 		if (!generateDiagrams)
 			return false;
@@ -701,5 +764,5 @@
 		}
 		if (configuration.creatediagrams_energyusage) {
-			for(ResourceType resType: resourceEnergyDiagrams.keySet()){
+			for(ResourceType resType: resourcePowerUsageDiagrams.keySet()){
 				resourceEnergyDiagram = getResourcesEnergyDiagram(resType, chartName,
 						subtitle, simulationTime);
@@ -708,4 +771,14 @@
 			}
 		}
+		
+		
+		if (configuration.creatediagrams_airflow) {
+			for(ResourceType resType: resourceAirFlowDiagrams.keySet()){
+				resourceAirFlowDiagram = getResourcesAirFlowDiagram(resType, chartName,
+						subtitle, simulationTime);
+				if (!saveXYPlotChart(resourceAirFlowDiagram, fileName + "AirThroughput - "+resType))
+					return false;
+			}
+		}
 		return true;
 	}
@@ -713,5 +786,5 @@
 	private JFreeChart getResourcesLoadDiagram(ResourceType resType, String chartName, Title subtitle,
 			String simulationTime) {
-		String cpu = "CPU";
+		String cpu = "UTILIZATION [%]";
 		boolean urls = false;
 		boolean tooltip = true;
@@ -750,5 +823,5 @@
 		DateAxis xAxis = new DateAxis(simulationTime);
 
-		List<XYDataset> energyDiagram = resourceEnergyDiagrams.get(resType);
+		List<XYDataset> energyDiagram = resourcePowerUsageDiagrams.get(resType);
 		for (XYDataset dataset : energyDiagram) {
 
@@ -759,4 +832,35 @@
 			XYPlot tPlot = tChart.getXYPlot();
 			NumberAxis yAxis = new NumberAxis(energy);
+			yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
+			tPlot.setRangeAxis(yAxis);
+			XYStepAreaRenderer rend = (XYStepAreaRenderer) tPlot.getRenderer();
+			rend.setShapesVisible(false);
+			cPlot.add(tPlot);
+		}
+		cPlot.setDomainAxis(xAxis);
+		cPlot.setDomainAxisLocation(AxisLocation.TOP_OR_LEFT);
+		JFreeChart chart = new JFreeChart(chartName, cPlot);
+		chart.addSubtitle(subtitle);
+		return chart;
+	}
+	
+	private JFreeChart getResourcesAirFlowDiagram(ResourceType resType, String chartName,
+			Title subtitle, String simulationTime) {
+		String airFlow = "AIR FLOW [m^3/min]";
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		CombinedDomainXYPlot cPlot = new CombinedDomainXYPlot();
+		DateAxis xAxis = new DateAxis(simulationTime);
+
+		List<XYDataset> airFlowDiagram = resourceAirFlowDiagrams.get(resType);
+		for (XYDataset dataset : airFlowDiagram) {
+
+			JFreeChart tChart = ChartFactory.createXYStepAreaChart("", "",
+					null, dataset, PlotOrientation.VERTICAL, legend, tooltip,
+					urls);
+
+			XYPlot tPlot = tChart.getXYPlot();
+			NumberAxis yAxis = new NumberAxis(airFlow);
 			yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
 			tPlot.setRangeAxis(yAxis);
@@ -870,11 +974,11 @@
 		XYSeriesCollection dataset = new XYSeriesCollection();
 		XYSeries data = new XYSeries(resStats.resourceName, false, true);
-		Map<Long, Integer> usage = resStats.getUsage();
+		Map<Long, Double> usage = resStats.getUsage();
 		
 		for (Long key : usage.keySet()) {
-			Integer val = usage.get(key);
-			double newv =100*val/basicResStats.size();
-			int newinv = (int)newv;
-			data.add(key, new Integer(newinv));
+			Double val = usage.get(key);
+			double newv = 100 * val;
+			//System.out.println(newv+":"+val+";"+basicResStats.size());
+			data.add(key, new Double(newv));
 		}
 		dataset.addSeries(data);
@@ -950,4 +1054,25 @@
 	}
 	
+	private double calculateAirFlowLoad(ResourceAirFlowStats resAirFlowStats ){
+		double meanAirFlow = 0;
+		long time = 0;
+		double usage = 0;
+		Map<Long, Double> airFlow = resAirFlowStats.getAirFlow();
+		for (Long key : airFlow.keySet()) {
+			
+			if (time != 0) {
+				meanAirFlow += (usage * (key - time))
+						/ (endSimulationTime - startSimulationTime);
+
+				time = key;
+			} else {
+				time = key;
+			}
+			usage = (double) airFlow.get(key);
+		}
+		return meanAirFlow;
+	}
+	
+	
 	/*private void createPEGanttDiagram(String peName,
 			String uniqueTaskID, Map<String, Object> historyItem) {
@@ -1006,5 +1131,4 @@
 			Job job = (Job) jobs.get(i);
 
-			//List<TaskInterface> execList = JobRegistry.getInstance("COMPUTING_GRID_0#BROKER").getAllSubmittedTasks();
 			List<Executable> execList = jr.getExecutableTasks().getJobExecutables(job.getId());
 			List<TaskStats> taskStatsList = new ArrayList<TaskStats>();
@@ -1346,5 +1470,4 @@
 		statsData.put(RESOURCES_RESERVATION_LOAD, accStats.meanEnergyUsage);
 		statsData.put(RESOURCES_QUEUE_LENGTH, accStats.meanQueueLength);
-
 	}
 
@@ -1417,4 +1540,6 @@
 	chartLoad,
 	textEnergy,
-	chartEnergy;
+	chartEnergy,
+	textAirFlow,
+	chartAirFlow;
 }
Index: DCWoRMS/trunk/src/simulator/stats/implementation/ResourceAirFlowStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/ResourceAirFlowStats.java	(revision 495)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/ResourceAirFlowStats.java	(revision 495)
@@ -0,0 +1,66 @@
+package simulator.stats.implementation;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import schedframe.resources.ResourceType;
+import simulator.stats.implementation.out.StatsSerializer;
+
+public class ResourceAirFlowStats {
+	protected Map<Long, Double> airFlow;
+	protected String resourceName;
+	protected String usageType;
+	protected ResourceType resourceType;
+	protected double meanValue;
+	protected double sumValue;
+	
+	public void setSumUsage(double sumUsage) {
+		this.sumValue = sumUsage;
+	}
+
+	public double getSumUsage() {
+		return sumValue;
+	}
+	public void setMeanUsage(double meanUsage) {
+		this.meanValue = meanUsage;
+	}
+	
+	public double getMeanUsage() {
+		return meanValue;
+	}
+	
+	private String[] headers = { "resourceName", "timestamp", "value" };
+	
+	public ResourceAirFlowStats (String resourceName, ResourceType resourceType, String usageType) {
+		this.resourceName = resourceName;
+		this.resourceType = resourceType;
+		this.usageType = usageType;
+		this.airFlow = new TreeMap<Long, Double>();
+		this.meanValue = 0;
+	}
+
+	public String getResourceName() {
+		return this.resourceName;
+	}
+	
+	public ResourceType getResourceType() {
+		return resourceType;
+	}
+
+	public String getUsageType() {
+		return this.usageType;
+	}	
+
+	public Map<Long, Double> getAirFlow() {
+		return this.airFlow;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/ResourceUsageStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/ResourceUsageStats.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/ResourceUsageStats.java	(revision 495)
@@ -15,5 +15,5 @@
 public class ResourceUsageStats implements StatsInterface {
 
-	protected Map<Long, Integer> usage;
+	protected Map<Long, Double> usage;
 	protected String resourceName;
 	protected String usageType;
@@ -31,5 +31,5 @@
 		this.resourceType = resourceType;
 		this.usageType = usageType;
-		this.usage = new TreeMap<Long, Integer>();
+		this.usage = new TreeMap<Long, Double>();
 		this.meanUsage = 0;
 	}
@@ -51,5 +51,5 @@
 	}	
 
-	public Map<Long, Integer> getUsage() {
+	public Map<Long, Double> getUsage() {
 		return this.usage;
 	}
Index: DCWoRMS/trunk/src/simulator/ConfigurationOptions.java
===================================================================
--- DCWoRMS/trunk/src/simulator/ConfigurationOptions.java	(revision 493)
+++ DCWoRMS/trunk/src/simulator/ConfigurationOptions.java	(revision 495)
@@ -67,4 +67,5 @@
 	public static final String CREATEDIAGRAMS_UTILIZATION = CREATEDIAGRAMS + ".utilization";
 	public static final String CREATEDIAGRAMS_ENERGYUSAGE = CREATEDIAGRAMS + ".energyusage";
+	public static final String CREATEDIAGRAMS_AIRFLOW = CREATEDIAGRAMS + ".airflow";
 	public static final String CREATEDIAGRAMS_RESOURCES_SCALE = CREATEDIAGRAMS_UTILIZATION + ".scale";
 	public static final String CREATEDIAGRAMS_TASKS = CREATEDIAGRAMS + ".tasks";
@@ -163,4 +164,5 @@
 	public boolean creatediagrams_resources = true;
 	public boolean creatediagrams_energyusage = true;
+	public boolean creatediagrams_airflow = true;
 	public boolean creatediagrams_tasks = true;
 	public boolean creatediagrams_taskswaitingtime = true;
@@ -173,4 +175,5 @@
 	
 	public String[] resForEnergyChart;
+	public String[] resForAirFlowChart;
 	public String[] resForUtilizationChart;
 	
@@ -302,4 +305,14 @@
 			co.creatediagrams_energyusage = createDiagrams;
 		}
+		
+		try {
+			co.resForAirFlowChart = bundle.getString(CREATEDIAGRAMS_AIRFLOW).split(";");
+			if(co.resForAirFlowChart.length > 0){
+				co.creatediagrams_airflow = true && createDiagrams;
+			}
+		} catch(MissingResourceException e){
+			co.creatediagrams_airflow = createDiagrams;
+		}
+		
 		try {
 			co.creatediagrams_tasks = Boolean.valueOf(
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java	(revision 495)
@@ -1,5 +1,8 @@
 package schedframe.resources.computing.profiles.energy.airthroughput;
 
+import java.util.ArrayList;
 import java.util.List;
+
+import org.joda.time.DateTimeUtils;
 
 import schedframe.Parameters;
@@ -7,4 +10,6 @@
 
 public class AirThroughputProfile {
+	
+	protected List<AirFlowValue> airFlowHistory;
 	
 	protected AirThroughputEstimationPlugin airThroughputEstimationPlugin;
@@ -16,8 +21,37 @@
 		this.airThroughputEstimationPlugin = airThroughputEstimationPlugin;
 		this.airThroughputStates = airThroughputStates;
+		this.airFlowHistory = new ArrayList<AirFlowValue>();
 	}
 
 	public List<AirThroughputState> getAirThroughputStates() {
 		return airThroughputStates;
+	}
+	
+	public void addToPowerUsageHistory(double airFlow) {
+
+		if (airFlowHistory.size() == 0) {
+			AirFlowValue usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow);
+			airFlowHistory.add(usage);
+			return;
+		}
+
+		int lastIdx = airFlowHistory.size() - 1;
+		double lastAirFlow = airFlowHistory.get(lastIdx).getValue();
+		if (lastAirFlow != airFlow) {
+			AirFlowValue usage = airFlowHistory.get(lastIdx);
+			long currentTime = DateTimeUtils.currentTimeMillis();
+			if (usage.getTimestamp() == currentTime) {
+				usage.setValue(airFlow);
+				if(lastIdx > 0 && airFlowHistory.get(lastIdx - 1).getValue() == airFlow)
+					airFlowHistory.remove(usage);
+			} else {
+				usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow);
+				airFlowHistory.add(usage);
+			}
+		}
+	}
+
+	public List<AirFlowValue> getAirThroughputHistory() {
+		return airFlowHistory;
 	}
 	
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java	(revision 495)
@@ -10,5 +10,5 @@
 	public String getAirThroughputState();
 	
-	public boolean setAirThroughputState(String airThrougputState);
+	public boolean setAirThroughputState(String airThroughputState);
 	
 	public boolean supportAirThroughputState(String powerState);
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThroughputInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThroughputInterface.java	(revision 495)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThroughputInterface.java	(revision 495)
@@ -0,0 +1,74 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
+
+public class DefaultAirThroughputInterface implements AirThroughputInterface{
+
+	protected String currentAirThroughputState;
+	protected AirThroughputProfile airThroughputProfile;
+	protected ComputingResource resource;
+	
+	public DefaultAirThroughputInterface(ComputingResource resource, AirThroughputProfile airThroughputProfile){
+		this.resource = resource;
+		this.airThroughputProfile = airThroughputProfile;
+	}
+	
+	public String getAirThroughputState() {
+		return currentAirThroughputState;
+	}
+
+	public boolean setAirThroughputState(String state) {
+		if(supportAirThroughputState(state)){
+			currentAirThroughputState = state;
+			
+			//TO DO - notifications should be called for all resources starting form the lowest layer
+			resource.handleEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, resource.getName()));
+
+			return true;
+		}
+		return false;
+	}
+
+	public boolean supportAirThroughputState(String state) {
+		for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+			if(airFlowState.getName().equals(state)){
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public List<AirThroughputState> getSupportedAirThroughputStates() throws NoSuchFieldException {
+		List<AirThroughputState> airThroughputStates = new ArrayList<AirThroughputState>();
+		for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+			airThroughputStates.add(airFlowState);
+		}
+		return airThroughputStates;
+	}
+
+	public double getPowerConsumption(String state) throws NoSuchFieldException {
+		double powerConsumption = 0;
+		if(supportAirThroughputState(state)){
+			for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+				if(airFlowState.getName().equals(state)){
+					powerConsumption = airFlowState.getPowerUsage();
+					break;
+				}
+			}
+		}
+		return powerConsumption;
+	}
+
+	public Parameters getParameters() {
+		return airThroughputProfile.getParameters();
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThrougputInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThrougputInterface.java	(revision 477)
+++ 	(revision )
@@ -1,64 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import schedframe.Parameters;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
-import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
-
-public class DefaultAirThrougputInterface implements AirThroughputInterface{
-
-	protected String currentAirThroughputState;
-	protected AirThroughputProfile airThroughputProfile;
-	protected ComputingResource resource;
-	
-	public String getAirThroughputState() {
-		return currentAirThroughputState;
-	}
-
-	public boolean setAirThroughputState(String state) {
-		if(supportAirThroughputState(state)){
-			currentAirThroughputState = state;
-			return true;
-		}
-		return false;
-	}
-
-	public boolean supportAirThroughputState(String state) {
-
-		for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
-			if(airFlowState.getName().equals(state)){
-				return true;
-			}
-		}
-		return false;
-	}
-
-	public List<AirThroughputState> getSupportedAirThroughputStates() throws NoSuchFieldException {
-		List<AirThroughputState> airThroughputStates = new ArrayList<AirThroughputState>();
-		for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
-			airThroughputStates.add(airFlowState);
-		}
-		return airThroughputStates;
-	}
-
-	public double getPowerConsumption(String state) throws NoSuchFieldException {
-		double powerConsumption = 0;
-		if(supportAirThroughputState(state)){
-			for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
-				if(airFlowState.getName().equals(state)){
-					powerConsumption = airFlowState.getPowerUsage();
-					break;
-				}
-			}
-		}
-		return powerConsumption;
-	}
-
-	public Parameters getParameters() {
-		return airThroughputProfile.getParameters();
-	}
-
-}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputInterfaceFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputInterfaceFactory.java	(revision 495)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputInterfaceFactory.java	(revision 495)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.DefaultAirThroughputInterface;
+
+public class AirThroughputInterfaceFactory {
+	
+	public static AirThroughputInterface createAirThroughputInterface(ComputingResource resource, AirThroughputProfile atp){
+		if(atp == null)
+			return null;
+		AirThroughputInterface airThroughputInterface = new DefaultAirThroughputInterface(resource, atp);
+
+		return airThroughputInterface;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java	(revision 495)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java	(revision 495)
@@ -0,0 +1,11 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import schedframe.resources.computing.profiles.energy.MeasurementHistory;
+
+public class AirFlowValue extends MeasurementHistory{
+
+	public AirFlowValue(long timestamp, double value){
+		super(timestamp, value);
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 495)
@@ -11,9 +11,11 @@
 import schedframe.resources.computing.extensions.ExtensionException;
 import schedframe.resources.computing.extensions.ExtensionType;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
 import schedframe.resources.computing.profiles.energy.power.PowerProfile;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
 
-public class EnergyExtension implements Extension/*, ResourceVisitor */{
+public class EnergyExtension implements Extension{
 
 	private Log log = LogFactory.getLog(EnergyExtension.class);
@@ -21,5 +23,8 @@
 	protected PowerInterface powerInterface;
 	protected PowerProfile powerProfile;
-
+	
+	protected AirThroughputInterface airFlowInterface;
+	protected AirThroughputProfile airFlowProfile;
+	
   	protected ComputingResource computingResource;
 
@@ -29,10 +34,17 @@
 	}
 
-	@Override
+	public EnergyExtension(PowerInterface powerInterface, PowerProfile powerProfile,
+			AirThroughputInterface airFlowInterface, AirThroughputProfile airFlowProfile) {
+		super();
+		this.powerInterface = powerInterface;
+		this.powerProfile = powerProfile;
+		this.airFlowInterface = airFlowInterface;
+		this.airFlowProfile = airFlowProfile;
+	}
+
 	public boolean supportsEvent(Event event) {
 
 		if(powerProfile == null || powerProfile.getEnergyEstimationPlugin() == null)
 			return false;
-		
 		if(event.getType().getName().equals(EnergyEventType.POWER_STATE_CHANGED.getName()))
 			return true;
@@ -43,10 +55,14 @@
 		else if(event.getType().getName().equals(EnergyEventType.TASK_FINISHED.getName()))
 			return true;
+		
+		if(airFlowProfile == null)
+			return false;	
+		if(event.getType().getName().equals(EnergyEventType.AIRFLOW_STATE_CHANGED.getName()))
+			return true;
+		
 		else return false;
 
 	}
-	
 
-	@Override
 	public void handleEvent(Event event) {
 		EnergyEvent enEvent = (EnergyEvent)event;
@@ -87,15 +103,19 @@
 			//System.out.println(this.resource.getName() + " - ESTIMATED ENERGY:" + power);
 			powerProfile.addToPowerUsageHistory(power);
-
+			break;
+		case AIRFLOW_STATE_CHANGED:
+			System.out.println("=====");
+			double airFlow = powerProfile.getEnergyEstimationPlugin().estimateAirThroughput(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			airFlowProfile.addToPowerUsageHistory(airFlow);
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			powerProfile.addToPowerUsageHistory(power);
 			break;
 		}
 	}
-	
-	@Override
+
 	public void init(Properties properties) throws ExtensionException {
 		// TODO Auto-generated method stub
 	}
 
-	@Override
 	public ExtensionType getType() {
 		return ExtensionType.ENERGY_EXTENSION;
@@ -118,4 +138,11 @@
 	}
 
+	public AirThroughputInterface getAirThroughputInterface() {
+		return airFlowInterface;
+	}
+
+	public AirThroughputProfile getAirFlowProfile() {
+		return airFlowProfile;
+	}
 
 }
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/MeasurementHistory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/MeasurementHistory.java	(revision 495)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/MeasurementHistory.java	(revision 495)
@@ -0,0 +1,25 @@
+package schedframe.resources.computing.profiles.energy;
+
+public class MeasurementHistory {
+	
+	protected long timestamp;
+	protected double value;
+
+	public MeasurementHistory (long timestamp, double value){
+		this.timestamp = timestamp;
+		this.value = value;
+	}
+	
+	public long getTimestamp() {
+		return timestamp;
+	}
+
+	public double getValue() {
+		return value;
+	}
+	
+	public void setValue(double value) {
+		this.value = value;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerUsage.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerUsage.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerUsage.java	(revision 495)
@@ -1,24 +1,10 @@
 package schedframe.resources.computing.profiles.energy.power;
 
-public class PowerUsage {
+import schedframe.resources.computing.profiles.energy.MeasurementHistory;
 
-	protected long timestamp;
-	protected double value;
+public class PowerUsage extends MeasurementHistory{
 
 	public PowerUsage(long timestamp, double value){
-		this.timestamp = timestamp;
-		this.value = value;
-	}
-	
-	public long getTimestamp() {
-		return timestamp;
-	}
-
-	public double getValue() {
-		return value;
-	}
-	
-	public void setValue(double value) {
-		this.value = value;
+		super(timestamp, value);
 	}
 	
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerInterfaceFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerInterfaceFactory.java	(revision 495)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerInterfaceFactory.java	(revision 495)
@@ -0,0 +1,51 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+
+public class PowerInterfaceFactory {
+
+
+
+	//new1
+	/*public static PowerInterface createPowerProfile(ResourceType resourceType, List<PowerState> powerStates, List<PState> pStates, String eepn){
+
+		PowerInterface powerProfile;
+
+		switch(resourceType){
+			case DataCenter: powerProfile = new DataCenterPowerInterfaceNew(eepn, powerStates); break;
+			case ComputingNode: powerProfile = new ComputingNodePowerInterfaceNew(eepn, powerStates); break;
+			case Processor: powerProfile = new CPUPowerInterfaceNew(eepn, powerStates, pStates); break;
+			default:
+				throw new IllegalArgumentException("ResourceType " + resourceType + " is not supported.");
+		}
+
+		return powerProfile;
+	}*/
+	
+	public static PowerInterface createPowerInterface(ComputingResource resource, PowerProfile pp){
+		if(pp == null)
+			return null;
+		PowerInterface powerInterface;
+
+		if(resource.getType().getName().equals(StandardResourceType.DataCenter.getName()))
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.DataCenterPowerInterface(resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.ComputingNode.getName()))
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface(resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.Processor.getName()))
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface(resource, pp);
+		else 
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingResourcePowerInterface(resource, pp);
+
+		/*switch(resource.getType()){
+			case DataCenter: powerInterface = new test.rewolucja.energy.profile.implementation.alternative2.DataCenterPowerInterfaceNew(resource, pp); break;
+			case ComputingNode: powerInterface = new test.rewolucja.energy.profile.implementation.alternative2.ComputingNodePowerInterfaceNew(resource, pp); break;
+			case Processor: powerInterface = new test.rewolucja.energy.profile.implementation.alternative2.CPUPowerInterfaceNew(resource, pp); break;
+			default:
+				throw new IllegalArgumentException("ResourceType " + resource.getType() + " is not supported.");
+		}*/
+
+		return powerInterface;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java	(revision 495)
@@ -22,13 +22,13 @@
 	
 
-	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> supportedPowerStates) {
+	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> powerStates) {
 		this.energyEstimationPlugin = energyEstimationPlugin;
 		this.powerUsage = new ArrayList<PowerUsage>();
-		this.supportedPowerStates = supportedPowerStates;
+		this.supportedPowerStates = powerStates;
 	}
 	
-	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> supportedPowerStates,  List<PState> pStates) {
+	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> powerStates,  List<PState> pStates) {
 		this.energyEstimationPlugin = energyEstimationPlugin;
-		this.supportedPowerStates = supportedPowerStates;
+		this.supportedPowerStates = powerStates;
 		this.powerUsage = new ArrayList<PowerUsage>();
 		if(pStates.size() > 0)
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java	(revision 495)
@@ -7,9 +7,6 @@
 import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
 
-public class DataCenterPowerInterface extends AbstractPowerInterface{
+public class DataCenterPowerInterface extends ComputingResourcePowerInterface{
 
-
-
-	
 	public DataCenterPowerInterface(ComputingResource resource, PowerProfile pp){
 		super(resource, pp);
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 495)
@@ -10,5 +10,5 @@
 import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
 
-public class ComputingNodePowerInterface extends AbstractPowerInterface{
+public class ComputingNodePowerInterface extends ComputingResourcePowerInterface{
 
 	public static long START_TIME = 600000;
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 495)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 495)
@@ -0,0 +1,119 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.joda.time.DateTimeUtils;
+
+import schedframe.Parameters;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerState;
+import schedframe.resources.computing.profiles.energy.power.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.PowerUsage;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+
+public class ComputingResourcePowerInterface implements PowerInterface{
+
+	protected PowerStateName currentPowerState;
+	protected PowerProfile powerProfile;
+	protected ComputingResource resource;
+	
+	public ComputingResourcePowerInterface(ComputingResource resource, PowerProfile powerProfile){
+		this.resource = resource;
+		this.powerProfile = powerProfile;
+		this.currentPowerState = StandardPowerStateName.ON;
+	}
+	
+	public boolean setPowerState(PowerStateName state) {
+		if(supportPowerState(state)){
+			currentPowerState = state;
+
+			for(ComputingResource child:resource.getChildren()){
+				if(child.getPowerInterface().supportPowerState(state))
+					child.getPowerInterface().setPowerState(state);
+			}
+
+			if(state == StandardPowerStateName.OFF){
+				resource.setStatus(ResourceStatus.UNAVAILABLE);
+			}
+			else if(state == StandardPowerStateName.ON){
+				resource.setStatus(ResourceStatus.FREE);
+			}
+			//notifications from all levels
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName()));
+
+			//notification from last level
+			//if (resource.getChildren() == null) resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource));
+			
+			return true;
+		}
+		return false;
+	}
+	
+
+	public PowerStateName getPowerState() {
+		return currentPowerState;
+	}
+
+	public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException {
+		List<PowerState> powerStates = new ArrayList<PowerState>();
+		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+			powerStates.add(powerState);
+		}
+		return powerStates;
+	}
+
+	public boolean supportPowerState(PowerStateName state) {
+		try {
+			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+				if(powerState.getName().equals(state)){
+					return true;
+				}
+			}
+		} catch (NoSuchFieldException e) {
+			return false;
+		}
+		return false;
+		
+	}
+	
+	public double getPowerConsumption(PowerStateName state) throws NoSuchFieldException {
+		double powerConsumption = 0;
+		if(supportPowerState(state)){
+			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+				if(powerState.getName().equals(state)){
+					powerConsumption = powerState.getPowerUsage();
+					break;
+				}
+			}
+		}
+		return powerConsumption;
+	}
+
+	public PowerUsage getRecentPowerUsage() {
+		PowerUsage powerUsage = null;
+		int lastIdx = getPowerUsageHistory().size() - 1;
+		if(lastIdx >= 0)
+			powerUsage = getPowerUsageHistory().get(lastIdx);
+		else {	
+			try {
+				powerUsage = new PowerUsage(DateTimeUtils.currentTimeMillis(), getPowerConsumption(currentPowerState));
+			} catch (NoSuchFieldException e) {
+			}
+		}
+		return powerUsage;
+	}
+	
+	public List<PowerUsage> getPowerUsageHistory(){
+		return powerProfile.getPowerUsageHistory();
+	}
+	
+	public Parameters getParameters() {
+		return powerProfile.getParameters();
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 494)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 495)
@@ -1,5 +1,4 @@
 package schedframe.resources.computing.profiles.energy.power.ui;
 
-import gridsim.dcworms.DCWormsTags;
 
 import java.util.Map;
@@ -16,5 +15,5 @@
 import schedframe.resources.units.StandardResourceUnitName;
 
-public class ProcessorPowerInterface extends AbstractPowerInterface {
+public class ProcessorPowerInterface extends ComputingResourcePowerInterface {
 
 	protected PState currentPState;
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/AbstractPowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/AbstractPowerInterface.java	(revision 477)
+++ 	(revision )
@@ -1,119 +1,0 @@
-package schedframe.resources.computing.profiles.energy.power.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.joda.time.DateTimeUtils;
-
-import schedframe.Parameters;
-import schedframe.resources.ResourceStatus;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.profiles.energy.EnergyEvent;
-import schedframe.resources.computing.profiles.energy.EnergyEventType;
-import schedframe.resources.computing.profiles.energy.power.PowerProfile;
-import schedframe.resources.computing.profiles.energy.power.PowerState;
-import schedframe.resources.computing.profiles.energy.power.PowerStateName;
-import schedframe.resources.computing.profiles.energy.power.PowerUsage;
-import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
-
-public abstract class AbstractPowerInterface implements PowerInterface{
-
-	protected PowerStateName currentPowerState;
-	protected PowerProfile powerProfile;
-	protected ComputingResource resource;
-	
-	public AbstractPowerInterface(ComputingResource resource, PowerProfile powerProfile){
-		this.resource = resource;
-		this.powerProfile = powerProfile;
-		this.currentPowerState = StandardPowerStateName.ON;
-	}
-	
-	public boolean setPowerState(PowerStateName state) {
-		if(supportPowerState(state)){
-			currentPowerState = state;
-
-			for(ComputingResource child:resource.getChildren()){
-				if(child.getPowerInterface().supportPowerState(state))
-					child.getPowerInterface().setPowerState(state);
-			}
-
-			if(state == StandardPowerStateName.OFF){
-				resource.setStatus(ResourceStatus.UNAVAILABLE);
-			}
-			else if(state == StandardPowerStateName.ON){
-				resource.setStatus(ResourceStatus.FREE);
-			}
-			//notifications from all levels
-			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName()));
-
-			//notification from last level
-			//if (resource.getChildren() == null) resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource));
-			
-			return true;
-		}
-		return false;
-	}
-	
-
-	public PowerStateName getPowerState() {
-		return currentPowerState;
-	}
-
-	public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException {
-		List<PowerState> powerStates = new ArrayList<PowerState>();
-		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
-			powerStates.add(powerState);
-		}
-		return powerStates;
-	}
-
-	public boolean supportPowerState(PowerStateName state) {
-		try {
-			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
-				if(powerState.getName().equals(state)){
-					return true;
-				}
-			}
-		} catch (NoSuchFieldException e) {
-			return false;
-		}
-		return false;
-		
-	}
-	
-	public double getPowerConsumption(PowerStateName state) throws NoSuchFieldException {
-		double powerConsumption = 0;
-		if(supportPowerState(state)){
-			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
-				if(powerState.getName().equals(state)){
-					powerConsumption = powerState.getPowerUsage();
-					break;
-				}
-			}
-		}
-		return powerConsumption;
-	}
-
-	public PowerUsage getRecentPowerUsage() {
-		PowerUsage powerUsage = null;
-		int lastIdx = getPowerUsageHistory().size() - 1;
-		if(lastIdx >= 0)
-			powerUsage = getPowerUsageHistory().get(lastIdx);
-		else {	
-			try {
-				powerUsage = new PowerUsage(DateTimeUtils.currentTimeMillis(), getPowerConsumption(currentPowerState));
-			} catch (NoSuchFieldException e) {
-			}
-		}
-		return powerUsage;
-	}
-	
-	public List<PowerUsage> getPowerUsageHistory(){
-		return powerProfile.getPowerUsageHistory();
-	}
-	
-	public Parameters getParameters() {
-		return powerProfile.getParameters();
-	}
-
-}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfileFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfileFactory.java	(revision 477)
+++ 	(revision )
@@ -1,50 +1,0 @@
-package schedframe.resources.computing.profiles.energy.power;
-
-import schedframe.resources.StandardResourceType;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
-
-public class PowerProfileFactory {
-
-
-
-	//new1
-	/*public static PowerInterface createPowerProfile(ResourceType resourceType, List<PowerState> powerStates, List<PState> pStates, String eepn){
-
-		PowerInterface powerProfile;
-
-		switch(resourceType){
-			case DataCenter: powerProfile = new DataCenterPowerInterfaceNew(eepn, powerStates); break;
-			case ComputingNode: powerProfile = new ComputingNodePowerInterfaceNew(eepn, powerStates); break;
-			case Processor: powerProfile = new CPUPowerInterfaceNew(eepn, powerStates, pStates); break;
-			default:
-				throw new IllegalArgumentException("ResourceType " + resourceType + " is not supported.");
-		}
-
-		return powerProfile;
-	}*/
-	
-	public static PowerInterface createPowerInterface(ComputingResource resource, PowerProfile pp){
-		if(pp == null)
-			return null;
-		PowerInterface powerInterface;
-
-		if(resource.getType().getName().equals(StandardResourceType.DataCenter.getName()))
-			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.DataCenterPowerInterface(resource, pp);
-		else if (resource.getType().getName().equals(StandardResourceType.ComputingNode.getName()))
-			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface(resource, pp);
-		else if (resource.getType().getName().equals(StandardResourceType.Processor.getName()))
-			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface(resource, pp);
-		else throw new IllegalArgumentException("ResourceType " + resource.getType() + " is not supported.");
-
-		/*switch(resource.getType()){
-			case DataCenter: powerInterface = new test.rewolucja.energy.profile.implementation.alternative2.DataCenterPowerInterfaceNew(resource, pp); break;
-			case ComputingNode: powerInterface = new test.rewolucja.energy.profile.implementation.alternative2.ComputingNodePowerInterfaceNew(resource, pp); break;
-			case Processor: powerInterface = new test.rewolucja.energy.profile.implementation.alternative2.CPUPowerInterfaceNew(resource, pp); break;
-			default:
-				throw new IllegalArgumentException("ResourceType " + resource.getType() + " is not supported.");
-		}*/
-
-		return powerInterface;
-	}
-}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEventType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEventType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEventType.java	(revision 495)
@@ -15,5 +15,8 @@
 	FREQUENCY_CHANGED(64),
 	VOLTAGE_CHANGED(128),
-	RESOURCE_FAILED(256)
+	
+	AIRFLOW_STATE_CHANGED(256),
+	
+	RESOURCE_FAILED(512)
 	;
 
Index: DCWoRMS/trunk/src/schedframe/resources/computing/Core.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/Core.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/Core.java	(revision 495)
@@ -3,5 +3,5 @@
 import schedframe.resources.computing.description.ComputingResourceDescription;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.units.CpuSpeed;
@@ -13,5 +13,5 @@
 	public Core (ComputingResourceDescription resDesc) {
 		super(resDesc);
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
 	}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/DataCenter.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/DataCenter.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/DataCenter.java	(revision 495)
@@ -3,5 +3,5 @@
 import schedframe.resources.computing.description.ComputingResourceDescription;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 
@@ -11,5 +11,5 @@
 		super(resDesc);
 		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));
 	}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/ComputingNode.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/ComputingNode.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/ComputingNode.java	(revision 495)
@@ -10,5 +10,5 @@
 import schedframe.resources.computing.extensions.ExtensionType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
@@ -26,5 +26,5 @@
 		
 		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
 	}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/ComputingResource.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/ComputingResource.java	(revision 494)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/ComputingResource.java	(revision 495)
@@ -28,4 +28,5 @@
 import schedframe.resources.computing.profiles.energy.EnergyEventType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.computing.properties.DefaultPropertiesBuilder;
@@ -68,5 +69,5 @@
 	}
 
-	//TODO remove if possible (check if all scenarios can be realized - statistics issue) , since it's temporary method
+	//TODO remove if possible (check if all scenarios can be realized - statistics issue), since it's a temporary method
 	private void addFakeProcessors() {
 		if(getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.PE) != null){
@@ -145,5 +146,4 @@
 		sec.execute(event);
 
-		
 		//old, correctly working method
 		/*if (extensionList != null) {
@@ -188,5 +188,5 @@
 	}
 	
-	protected List<? extends ComputingResource> searchDescendants(List<ResourceValidator> validators, boolean cutoff) {
+	protected List<? extends ComputingResource> searchDescendants(List<ResourceValidator> validators, boolean cutOff) {
 
 		List<ComputingResource> descendants = new ArrayList<ComputingResource>();
@@ -198,6 +198,4 @@
 				ComputingResource resource = toExamine.pop();
 				List<ComputingResource> resources = resource.getChildren();
-				/*if (resources == null)
-					continue;*/
 				int numberOfRes = resources.size();
 				for (int i = 0; i < numberOfRes; i++) {
@@ -205,5 +203,5 @@
 					if (resourceChild.match(validators)) {
 						descendants.add(resourceChild);
-						if(cutoff == false) {
+						if(cutOff == false) {
 							toExamine.addLast(resourceChild);
 						}
@@ -243,4 +241,16 @@
 		return null;
 	}
+	
+	public AirThroughputInterface getAirThroughputInterface(){
+		if (extensionList != null) {
+			for (Extension extension : extensionList) {
+				if (extension.getType() == ExtensionType.ENERGY_EXTENSION) {
+					EnergyExtension ee = (EnergyExtension)extension;
+					return ee.getAirThroughputInterface();
+				}
+			}
+		}
+		return null;
+	}
 
 	public Scheduler getScheduler() {
@@ -257,5 +267,5 @@
 	}
 
-	class SimpleEventHandler implements EventHandler{
+	class ComputingResourceEventHandler implements EventHandler{
 		
 		public void handleResourceEvent(Event event){
@@ -282,13 +292,21 @@
 	
 	public EventHandler getEventHandler(){
-		return new SimpleEventHandler();
+		return new ComputingResourceEventHandler();
 	}
 	
 	public void initiate(){
+		
 		ResourceEventCommand rec = new ResourceEventCommand(this);
-		EnergyEvent event = new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller");
+		EnergyEvent event = new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller");
 		event.setReason(EventReason.SIM_INIT);
 		rec.execute(event);
+		
+		rec = new ResourceEventCommand(this);
+		event = new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller");
+		event.setReason(EventReason.SIM_INIT);
+		rec.execute(event);
+		
 		//alternative way
+		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller"));
 		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller"));
 	}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/Processor.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/Processor.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/Processor.java	(revision 495)
@@ -8,5 +8,5 @@
 import schedframe.resources.computing.extensions.ExtensionType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface;
@@ -22,5 +22,5 @@
 		super(resDesc);
 		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
 	}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/ResourceFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/ResourceFactory.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/ResourceFactory.java	(revision 495)
@@ -20,4 +20,6 @@
 		if (resDesc.getType().equals(StandardResourceType.DataCenter))
 			return new DataCenter(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.Rack))
+			return  new Rack(resDesc);
 		else if (resDesc.getType().equals(StandardResourceType.ComputingNode))
 			return  new ComputingNode(resDesc);
Index: DCWoRMS/trunk/src/schedframe/resources/computing/Rack.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/Rack.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/Rack.java	(revision 495)
@@ -6,5 +6,5 @@
 import schedframe.resources.computing.description.ComputingResourceDescription;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 
@@ -14,5 +14,5 @@
 	public Rack (ComputingResourceDescription resDesc) {
 		super(resDesc);
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
 	}
