[104] | 1 | package gridsim.gssim; |
---|
| 2 | |
---|
| 3 | import eduni.simjava.Sim_stat; |
---|
| 4 | |
---|
| 5 | public class GssimConstants { |
---|
| 6 | |
---|
| 7 | public static final String START_TIME="start_time"; |
---|
| 8 | |
---|
| 9 | public static final String END_TIME = "end_time"; |
---|
| 10 | |
---|
| 11 | public static final String RESOURCES = "resources"; |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | public static final String RESOURCE_CONFIG_POWER_PROFILE = "powerprofile"; |
---|
| 15 | |
---|
| 16 | public static final String RESOURCE_CONFIG_POWER_PROFILE_CONFIG = "ppconfiguration"; |
---|
| 17 | |
---|
| 18 | public static final String RESOURCE_CONFIG_CPU_CORECNT = "corecount"; |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | /** |
---|
| 22 | * the links have the maximal baud rate - no delays |
---|
| 23 | */ |
---|
| 24 | public static final double DEFAULT_BAUD_RATE = Double.MAX_VALUE; |
---|
| 25 | |
---|
| 26 | /** |
---|
| 27 | * Default name suffix of the allocation policy for every resource |
---|
| 28 | */ |
---|
| 29 | public static final String DEFAULT_RESOURCE_MANAGER_NAME = "ResourceManager"; |
---|
| 30 | |
---|
| 31 | /** |
---|
| 32 | * The cost of processing per time unit |
---|
| 33 | */ |
---|
| 34 | public static final float DEFAULT_RESOURCE_PROCESSING_COST = 1f; |
---|
| 35 | |
---|
| 36 | /** |
---|
| 37 | * The default number of tasks in a single job |
---|
| 38 | */ |
---|
| 39 | public static final int DEFAULT_TASK_COUNT_IN_SINGLE_JOB = 1; |
---|
| 40 | |
---|
| 41 | /** |
---|
| 42 | * The name of the broker interface entity (the entity that invokes proper methods on the given plugin) |
---|
| 43 | */ |
---|
| 44 | public static final String BrokerInterfaceEntityName = "BrokerInterfaceEntity"; |
---|
| 45 | |
---|
| 46 | /** |
---|
| 47 | * The name of the output file with generated graphs |
---|
| 48 | */ |
---|
| 49 | public static final String GraphsFileName = "GssGraphs.sjg"; |
---|
| 50 | |
---|
| 51 | /** |
---|
| 52 | * The name of the file where the resources' statistical data are to be stored |
---|
| 53 | */ |
---|
| 54 | public static final String resourceStatisticsOutputFileName = "Stats_Resources.txt"; |
---|
| 55 | |
---|
| 56 | /** |
---|
| 57 | * The name of the file where the tasks' statistical data are to be stored |
---|
| 58 | */ |
---|
| 59 | public static final String tasksStatisitcsOutputFileName = "Stats_Tasks.txt"; |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | public static final String MANAGEMENT_SYSTEM = "ManagementSystem"; |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | /* |
---|
| 66 | * |
---|
| 67 | * STATISTICAL INFORMATION VARIABLES AND METHODS |
---|
| 68 | * |
---|
| 69 | */ |
---|
| 70 | |
---|
| 71 | /** |
---|
| 72 | * The utilization measure name |
---|
| 73 | */ |
---|
| 74 | public static final String USAGE_MEASURE_NAME = "Resource's utilization"; |
---|
| 75 | |
---|
| 76 | /** |
---|
| 77 | * The waiting tasks queue length measure name |
---|
| 78 | */ |
---|
| 79 | public static final String TASKS_QUEUE_LENGTH_MEASURE_NAME = "Mean queue task count"; |
---|
| 80 | |
---|
| 81 | /** |
---|
| 82 | * The paused tasks list length measure name |
---|
| 83 | */ |
---|
| 84 | public static final String PAUSED_TASKS_LIST_LENGTH_MEASURE_NAME = "Paused tasks list length"; |
---|
| 85 | |
---|
| 86 | /** |
---|
| 87 | * The waiting in reservation tasks queue length measure name |
---|
| 88 | */ |
---|
| 89 | public static final String TASKS_AR_QUEUE_LENGTH_MEASURE_NAME = "AR Tasks' queue length"; |
---|
| 90 | |
---|
| 91 | /** |
---|
| 92 | * @param queuesCount the number of queues for which the measures are to be added |
---|
| 93 | * @return a Sim_stat object to be used in all resources |
---|
| 94 | */ |
---|
| 95 | public static Sim_stat getResourcesStatisticsObject(int queuesCount) { |
---|
| 96 | Sim_stat stat = new Sim_stat(); |
---|
| 97 | //stat.add_measure(Sim_stat.ARRIVAL_RATE); |
---|
| 98 | //stat.add_measure(Sim_stat.QUEUE_LENGTH); |
---|
| 99 | //stat.add_measure(Sim_stat.RESIDENCE_TIME); |
---|
| 100 | //stat.add_measure(Sim_stat.SERVICE_TIME); |
---|
| 101 | stat.add_measure(Sim_stat.THROUGHPUT); |
---|
| 102 | //stat.add_measure(Sim_stat.UTILISATION); |
---|
| 103 | //stat.add_measure(Sim_stat.WAITING_TIME); |
---|
| 104 | |
---|
| 105 | stat.add_measure(USAGE_MEASURE_NAME, Sim_stat.STATE_BASED, true); //continuous |
---|
| 106 | for (int i = 0; i < queuesCount; ++i) { |
---|
| 107 | stat.add_measure(TASKS_QUEUE_LENGTH_MEASURE_NAME+"_"+Integer.toString(i), Sim_stat.STATE_BASED, true); //continuous |
---|
| 108 | } |
---|
| 109 | stat.add_measure(PAUSED_TASKS_LIST_LENGTH_MEASURE_NAME, Sim_stat.STATE_BASED, true); //continuous |
---|
| 110 | //stat.add_measure(TASKS_AR_QUEUE_LENGTH_MEASURE_NAME, Sim_stat.STATE_BASED, true); //continuous |
---|
| 111 | return stat; |
---|
| 112 | } |
---|
| 113 | |
---|
| 114 | /** |
---|
| 115 | * @return a Sim_stat object to be used in broker interface (plugin interface) |
---|
| 116 | */ |
---|
| 117 | public static Sim_stat getBrokersStatisticsObject() { |
---|
| 118 | Sim_stat stat = new Sim_stat(); |
---|
| 119 | //stat.add_measure(Sim_stat.ARRIVAL_RATE); |
---|
| 120 | //stat.add_measure(Sim_stat.QUEUE_LENGTH); |
---|
| 121 | //stat.add_measure(Sim_stat.RESIDENCE_TIME); |
---|
| 122 | //stat.add_measure(Sim_stat.SERVICE_TIME); |
---|
| 123 | stat.add_measure(Sim_stat.THROUGHPUT); |
---|
| 124 | //stat.add_measure(Sim_stat.UTILISATION); |
---|
| 125 | //stat.add_measure(Sim_stat.WAITING_TIME); |
---|
| 126 | return stat; |
---|
| 127 | } |
---|
| 128 | |
---|
| 129 | } |
---|