package test.rewolucja.resources.logical.implementation; import eduni.simjava.Sim_event; import gridsim.GridSimTags; import gridsim.IO_data; import gridsim.gssim.GssimTags; import java.util.HashMap; import java.util.List; import java.util.Map; import schedframe.resources.ResourceStateDescription; import schedframe.resources.providers.LocalSystem; import schedframe.resources.units.ResourceUnit; import schedframe.scheduling.utils.ResourceParameterName; import test.rewolucja.resources.logical.base.LogicalResource; import test.rewolucja.resources.physical.base.ComputingResource; import test.rewolucja.scheduling.implementation.ManagementSystem; public class Cluster extends LogicalResource{ public Cluster(ManagementSystem manSys) throws Exception { super(manSys); } public Cluster(ManagementSystem manSys, List res) throws Exception { super(manSys, res); } protected void processOtherRequest(Sim_event ev) { switch (ev.get_tag()) { case GssimTags.QUERY_RESOURCE_DESC: ResourceStateDescription desc = new ResourceStateDescription(new LocalSystem(get_name(), null, null)); Map units = new HashMap(); desc.addComputingResources(compResources); //ResourceComponentsNew resourceComponents = new ResourceComponentsNew(get_name()); //resourceComponents.addAll(resources); //units.put(ResourceParameterName.RESOURCECOMPONENTS, resourceComponents); desc.addResourceUnit(units); desc.setQueuesSize(managementSystem.getQueuesSize()); IO_data data = new IO_data(desc, 0, ev.get_src()); send(ev.get_src(), GridSimTags.SCHEDULE_NOW, GssimTags.QUERY_RESOURCE_DESC_RESULT, data); break; default: managementSystem.processEvent(ev); break; } } }