package simulator.stats.implementation; import schedframe.resources.ResourceType; import simulator.stats.implementation.out.StatsSerializer; public class ResourceUsefulWorkStats implements StatsInterface{ protected String resourceName; protected String usageType; protected ResourceType resourceType; protected long timestamp; protected double value; private String[] headers = { "resourceName", "timestamp", "usefulWork" }; public ResourceUsefulWorkStats (String resourceName, ResourceType resourceType, String usageType, double value, long timestamp) { this.resourceName = resourceName; this.resourceType = resourceType; this.usageType = usageType; this.value = value; this.timestamp = timestamp; if(usageType == null){ this.usageType = "usefulWork"; } } public ResourceUsefulWorkStats (String resourceName, ResourceType resourceType, String usageType, double value) { this(resourceName, resourceType, usageType, value, 0); } public double getValue() { return value; } public Object serialize(StatsSerializer serializer) { return serializer.visit(this); } public String getResourceName() { return this.resourceName; } public ResourceType getResourceType() { return resourceType; } public String getUsageType() { return this.usageType; } public String[] getHeaders() { return headers; } public long getTimestamp() { return timestamp; } }