From: <mar...@us...> - 2008-06-13 00:55:13
|
Revision: 183 http://gridsim.svn.sourceforge.net/gridsim/?rev=183&view=rev Author: marcos_dias Date: 2008-06-12 17:55:20 -0700 (Thu, 12 Jun 2008) Log Message: ----------- This update contains a few changes in the workload model, which allows one to extend the model in an easier way. It also provides the capability to query for particular free time slots from providers. Modified Paths: -------------- branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java branches/gridsim4.0-branch3/source/gridsim/turbo/SSGridlet.java branches/gridsim4.0-branch3/source/gridsim/turbo/WorkloadInterface.java Modified: branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java =================================================================== --- branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java 2008-06-13 00:55:20 UTC (rev 183) @@ -69,6 +69,7 @@ int rating = 377; // rating of each PE in MIPS int totalPE = 9; // total number of PEs for each Machine int totalMachine = 128; // total number of Machines + int i = 0; String[] resArray = new String[totalResource]; @@ -93,11 +94,19 @@ // uHi is going to contain log2 of the maximum number of PEs that a // parallel job can require double uHi = Math.log(totalPE * totalMachine) / Math.log(2d); - double uMed = uHi-2.5; - + + /* Here we modify the number of nodes required by parallel jobs + * as an example */ + double uMed = uHi-3.5; workload.setParallelJobProbabilities(Lublin99Workload.INTERACTIVE_JOBS, workload.getParallelJobULow(Lublin99Workload.INTERACTIVE_JOBS), uMed, uHi, workload.getParallelJobUProb(Lublin99Workload.INTERACTIVE_JOBS)); + + /* Here we modify the inter-arrival time for jobs as an example */ +// workload.setInterArrivalTimeParameters(Lublin99Workload.INTERACTIVE_JOBS, +// Lublin99Workload.AARR, 0.55D, +// Lublin99Workload.ANUM, Lublin99Workload.BNUM, +// Lublin99Workload.ARAR); // sets the workload to create 1000 jobs workload.setNumJobs(1000); Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/AvailabilityInfo.java 2008-06-13 00:55:20 UTC (rev 183) @@ -391,10 +391,15 @@ * they are not the scheduling options for jobs. * @param startTime the start time of the period. * @param finishTime the finish time of the period. + * @param duration the minimum duration of the free time slots. Free time slots + * whose time frame is smaller than <tt>duration</tt> will be ignored. + * @param numPEs the minimum number of PEs of the free time slots. Free time slots + * whose number of PEs is smaller than <tt>numPEs</tt> will be ignored. * @return a linked list with the time slots contained in this availability * information object within a specified period of time. */ - public LinkedList<TimeSlot> getSchedulingOptions(double startTime, double finishTime) { + public LinkedList<TimeSlot> getSchedulingOptions(double startTime, + double finishTime, int duration, int numPEs) { LinkedList<TimeSlot> slots = new LinkedList<TimeSlot>(); // start time cannot be smaller than the start time of the info obj @@ -431,13 +436,17 @@ double endTime = entry.getTime(); boolean different = !intersect.equals(slotRanges); if(j < (size-1) && different) { - TimeSlot slot = new TimeSlot(slotStart, endTime, slotRanges); - slots.add(slot); + if((endTime - slotStart) >= duration && slotRanges.getNumPE() >= numPEs) { + TimeSlot slot = new TimeSlot(slotStart, endTime, slotRanges); + slots.add(slot); + } slotRanges = intersect; } else if (j == (size-1)) { - TimeSlot slot = new TimeSlot(slotStart, finishTime, slotRanges); - slots.add(slot); + if((endTime - slotStart) >= duration && slotRanges.getNumPE() >= numPEs) { + TimeSlot slot = new TimeSlot(slotStart, finishTime, slotRanges); + slots.add(slot); + } continue; } Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/Lublin99Workload.java 2008-06-13 00:55:20 UTC (rev 183) @@ -47,6 +47,168 @@ * specification. * </ul> * <p> + * Details on how the distributions have been implemented and how their + * parameters can be configured are described below. Please note that this text + * was extracted from the C implementation of the model performed by Uri Lublin + * and Dror Feitelson: + * + * <p> + * The load generated can be changed by changing the values of the model parameters. + * Remember to set the number-of-nodes' parameters to fit your system. + * I distinguish between the two different types (batch or interactive) if the + * useJobType in the constructors is set to <tt>true</tt>. The program starts + * by initialising the model's parameters (according to the following constants + * definitions -- parameters values). Notice that if job type is set to + * <tt>true</tt>, there are different values to batch-parameters and + * interactive-parameters, and if this flag is <tt>false</tt> then they both get + * the same value (and the arbitrary type interactive). The workload calculates + * for each job its arrival arrival time (using 2 gamma distributions), + * number of nodes (using a two-stage-uniform distribution), runtime + * (using the number of nodes and hyper-gamma distribution) and type. + * + * <p> + * Some definitions: + * <ul> + * <li> 'l' - the mean load of the system + * <li> 'r' - the mean runtime of a job + * <li> 'ri' - the runtime of job 'i' + * <li> 'n' - the mean number of nodes of a job + * <li> 'ni' - the number of nodes of job 'i' + * <li> 'a' - the mean inter-arrival time of a job + * <li> 'ai' - the arrival time (from the beginning of the simulation) of job 'i' + * <li> 'P' - the number of nodes in the system (the system's size). + * </ul> + * + * Given ri,ni,ai,N or r,n,a,N we can calculate the expected load on the system + * + * <p> + * <tt> + * sum(ri * ni) + * load = --------------- + * P * max(ai) + * </tt> + * + * <p> + * We can calculate an approximation (exact if 'ri' and 'ni' are independent) + * + *<p> + *<tt> + * r * n + * approximate-load = ------- + * P * a + *</tt> + * + * <p> + * The model controls the r,m,a. + * One can change them by changing the values of the model's parameters. + * + * <p> + * ---------------------- <br> + * Changing the runtime: <br> + * ---------------------- <br> + * Let g ~ gamma(alpha,beta) then the expectation and variation of g are:<br> + * E(g) = alpha*beta ; Var(g) = alpha*(beta^2)<br> + * so the coefficient of variation is CV = sqrt(Var(g))/E(g) = 1/sqrt(alpha). + * One who wishes to enlarge the gamma random value without changing the CV + * can set a larger value to the parameter beta . If one wishes that the CV will + * change he may set a larger value to alpha parameter. + * Let hg ~ hyper-gamma(a1,b1,a2,b2,p) then the expectation and variation are: <br> + * E(hg) = p*a1*b1 + (1-p)*a2*b2<br> + * Var(hg) = p^2*a1*b1^2 + (1-p)^2*a2*b2^2<br> + * One who wishes to enlarge the hyper-gamma (or the runtime) random value may + * do that using one (or more) of the three following ways:<br> + * 1. enlarge the first gamma.<br> + * 2. and/or enlarge the second gamma.<br> + * 3. and/or set a smaller value to the 'p' parameter.(parameter p of hyper-gamma + * is the proportion of the first gamma). + * since in my model 'p' is dependent on the number of nodes (p=pa*nodes+pb) + * this is done by diminishing 'pa' and/or diminishing 'pb' such that 'p' + * will be smaller. Note that changing 'pa' affects the correlation + * between the number of nodes a job needs and its runtime. <br> + * <br> + * Use {@link #setRunTimeParameters(int, double, double, double, double, double, double)} + * in order to change the runtime parameters of jobs. + * + * <p> + * ------------------------ <br> + * Changing the correlation between the number of nodes a job needs and its runtime: <br> + * ------------------------ <br> + * The parameter 'pa' is responsible for that correlation. Since its negative + * as the number of nodes get larger so is the runtime. + * One who wishes no correlation between the nodes-number and the runtime should + * set 'pa' to be 0 or a small negative number close to 0. + * One who wishes to have strong such a correlation should set 'pa' to be not so + * close to 0 , for example -0.05 or -0.1 . Note that this affect the runtime + * which will be larger. One can take care of that by changing the other runtime + * parameters (a1,b1,a2,b2,pb). <br> + * + * <p> + * ----------------------------- <br> + * Changing the number of nodes: <br> + * ----------------------------- <br> + * Let u ~ uniform(a,b) then the expectation of u is E(u) = (a+b)/2. <br> + * Let tsu ~ two-stage-uniform(Ulow,Umed,Uhi,Uprob) then the expectation of tsu + * is E(tsu) = Uprob*(Ulow+Umed)/2 + (1-Uprob)*(Umed+Uhi)/2 = + * = (Uprob*Ulow + Umed + (1-Uprob)*Uhi)/2. <br> + * 'Ulow' is the log2 of the minimal number of nodes a job may run on. <br> + * 'Uhi' is the log2 of the system size. <br> + * 'Umed' is the changing point of the cdf function and should be set to <br> + * 'Umed' = 'Uhi' - 2.5. ('2.5' could be change between 1.5 to 3.5). <br> + * For example if the system size is 8 (Uhi = log2(8) = 3) its make no sense to + * set Umed to be 0 or 0.5 . In this case I would set Umed to be 1.5 , and maybe + * set Ulow to be 0.8 , so the probability of 2 would not be too small. + * 'Uprob' is the proportion of the first uniform (Ulow,Umed) and should be set + * to a value between 0.7 to 0.95. + *<br> + * One who wishes to enlarge the mean number of nodes may do that using one of + * the two following ways:<br> + * 1. set a smaller value to 'prob'<br> + * 2. and/or enlarge 'med'<br> + * Remember that changing the mean number of nodes will affect on the runtime + * too. <br> + * Use {@link #setParallelJobProbabilities(int, double, double, double, double)} + * to change the number of nodes and probability of parallel jobs. <br> + * Use {@link #setPower2Probability(int, double)} to change the probability of + * power of two jobs. <br> + * Use {@link #setSerialProbability(int, double)} to change the probability for + * serial or sequential jobs. <br> + * + * <p> + * -------------------------- <br> + * Changing the arrival time: <br> + * -------------------------- <br> + * The arrival time is calculated in two stages: <br> + * First stage : calculate the proportion of number of jobs arrived at every + * time interval (bucket). this is done using the gamma(anum,bnum) + * cdf and the CYCLIC_DAY_START. The weights array holds the points + * of all the buckets. <br> + * Second stage: foreach job calculate its inter-arrival time: <br> + * Generate a random value from the gamma(aarr,barr). + * The exponential of the random value is the + * points we have. While we have less points than the current + * bucket , "pay" the appropriate number of points and move to the + * next bucket (updating the next-arrival-time). + * <br> + * The parameters 'aarr' and 'barr' represent the inter-arrival-time in the + * rush hours. The parameters 'anum' and 'bnum' represent the number of jobs + * arrived (for every bucket). The proportion of bucket 'i' is: + * cdf (i+0.5 , anum , bnum) - cdf(i-0.5 , anum , bnum). + * We calculate this proportion foreach i from BUCKETS to (24+BUCKETS) , + * and the buckets (their indices) that are larger than or equal to 24 are move + * cyclically to the right place: + * (24 --> 0 , 25 --> 1 , ... , (24+BUCKETS) --> BUCKETS ) + * <br> + * One who wishes to change the mean inter-arrival time may do that in the + * following way: <br> + * - enlarge the rush-hours-inter-arrival time. + * This is done by enlarging the value of aarr or barr according to the wanted + * change of the CV. <br> + * One who wishes to change the daily cycle may change the values of 'anum' + * and/or 'bnum'<br> + * Use {@link #setInterArrivalTimeParameters(int, double, double, double, double, double)} + * to change the inter-arrival parameters. + * + * <p> * For more information on the workload model implemented here, please read * the following paper: <br> * Uri Lublin and Dror G. Feitelson, The Workload on Parallel Supercomputers: @@ -111,32 +273,40 @@ // ------------------- MODEL DEFAULT PARAMETERS ----------------------- - /* The parameters for number of nodes: - * serial_prob is the proportion of the serial jobs - * pow2_prob is the proportion of the jobs with power 2 number of nodes - * ULow , UMed , UHi and Uprob are the parameters for the two-stage-uniform - * which is used to calculate the number of nodes for parallel jobs. - * ULow is the log2 of the minimal size of job in the system (you can add or - * subtract 0.2 to give less/more probability to the minimal size) . - * UHi is the log2 of the maximal size of a job in the system (system's size) - * UMed should be in [UHi-1.5 , UHi-3.5] - * Uprob should be in [0.7 - 0.95] - */ - private static final double SERIAL_PROB_BATCH = 0.2927; - private static final double POW2_PROB_BATCH = 0.6686; - private static final double ULOW_BATCH = 1.2f; // smallest parallel batch job has 2 nodes - private static final double UMED_BATCH = 5; - private static final double UHI_BATCH = 7; // biggest batch job has 128 nodes - private static final double UPROB_BATCH = 0.875; + /** The default proportion of batch serial jobs */ + public static final double SERIAL_PROB_BATCH = 0.2927; + /** The default proportion of batch jobs with power 2 number of nodes */ + public static final double POW2_PROB_BATCH = 0.6686; + + /** ULow, UMed, UHi and Uprob are the parameters for the two-stage-uniform + * which is used to calculate the number of nodes for parallel jobs. + * ULow is the default log2 of the minimal size of job in the system for batch jobs. */ + public static final double ULOW_BATCH = 1.2f; // smallest parallel batch job has 2 nodes + /** UHi is the default log2 of the maximal size of a batch job in the system (system's size) */ + public static final double UHI_BATCH = 7; // biggest batch job has 128 nodes + /** Default UMed for batch jobs. Note that UMed should be in [UHi-1.5 , UHi-3.5] */ + public static final double UMED_BATCH = 5; + /** Default UProb for batch jobs. Note that Uprob should be in [0.7 - 0.95] */ + public static final double UPROB_BATCH = 0.875; - private static final double SERIAL_PROB_ACTIVE = 0.1541; - private static final double POW2_PROB_ACTIVE = 0.625; - private static final double ULOW_ACTIVE = 1; // smallest interactive parallel job has 2 nodes - private static final double UMED_ACTIVE = 3; - private static final double UHI_ACTIVE = 5.5f; // biggest interactive job has 45 nodes - private static final double UPROB_ACTIVE = 0.705; + /** The default proportion of interactive serial jobs */ + public static final double SERIAL_PROB_ACTIVE = 0.1541; + /** The default proportion of interactive jobs with power 2 number of nodes */ + public static final double POW2_PROB_ACTIVE = 0.625; - /* The parameters for the running time + /** ULow, UMed, UHi and Uprob are the parameters for the two-stage-uniform + * which is used to calculate the number of nodes for parallel jobs. + * ULow is the default log2 of the minimal size of job in the system for interactive jobs. */ + public static final double ULOW_ACTIVE = 1; // smallest interactive parallel job has 2 nodes + /** UHi is the default log2 of the maximal size of an interactive job in the system (system's size) */ + public static final double UHI_ACTIVE = 5.5f; // biggest interactive job has 45 nodes + /** Default UMed for interactive jobs. Note that UMed should be in [UHi-1.5 , UHi-3.5] */ + public static final double UMED_ACTIVE = 3; + /** Default UProb for interactive jobs. Note that Uprob should be in [0.7 - 0.95] */ + public static final double UPROB_ACTIVE = 0.705; + + /** + * The parameters for the running time * The running time is computed using hyper-gamma distribution. * The parameters a1,b1,a2,b2 are the parameters of the two gamma distributions * The p parameter of the hyper-gamma distribution is calculated as a straight @@ -144,19 +314,19 @@ * 'nodes' will be calculated in the program, here we defined the 'pa','pb' * parameters. */ - private static final double A1_BATCH = 6.57; - private static final double B1_BATCH = 0.823; - private static final double A2_BATCH = 639.1; - private static final double B2_BATCH = 0.0156; - private static final double PA_BATCH = -0.003; - private static final double PB_BATCH = 0.6986; + public static final double A1_BATCH = 6.57; + public static final double B1_BATCH = 0.823; + public static final double A2_BATCH = 639.1; + public static final double B2_BATCH = 0.0156; + public static final double PA_BATCH = -0.003; + public static final double PB_BATCH = 0.6986; - private static final double A1_ACTIVE = 3.8351; - private static final double B1_ACTIVE = 0.6605; - private static final double A2_ACTIVE = 7.073; - private static final double B2_ACTIVE = 0.6856; - private static final double PA_ACTIVE = -0.0118; - private static final double PB_ACTIVE = 0.9156; + public static final double A1_ACTIVE = 3.8351; + public static final double B1_ACTIVE = 0.6605; + public static final double A2_ACTIVE = 7.073; + public static final double B2_ACTIVE = 0.6856; + public static final double PA_ACTIVE = -0.0118; + public static final double PB_ACTIVE = 0.9156; /* The parameters for the inter-arrival time @@ -170,41 +340,41 @@ * a constant ,ARAR (Arrive-Rush-All-Ratio), to set the alpha parameter (the new * aarr) so it will represent the arrive-time at all hours of the day. */ - private static final double AARR_BATCH = 6.0415; - private static final double BARR_BATCH = 0.8531; - private static final double ANUM_BATCH = 6.1271; - private static final double BNUM_BATCH = 5.2740; - private static final double ARAR_BATCH = 1.0519; + public static final double AARR_BATCH = 6.0415; + public static final double BARR_BATCH = 0.8531; + public static final double ANUM_BATCH = 6.1271; + public static final double BNUM_BATCH = 5.2740; + public static final double ARAR_BATCH = 1.0519; - private static final double AARR_ACTIVE = 6.5510; - private static final double BARR_ACTIVE = 0.6621; - private static final double ANUM_ACTIVE = 8.9186; - private static final double BNUM_ACTIVE = 3.6680; - private static final double ARAR_ACTIVE = 0.9797; + public static final double AARR_ACTIVE = 6.5510; + public static final double BARR_ACTIVE = 0.6621; + public static final double ANUM_ACTIVE = 8.9186; + public static final double BNUM_ACTIVE = 3.6680; + public static final double ARAR_ACTIVE = 0.9797; /* * Here are the model's parameters for typeless data (no batch nor interactive) * We use those parameters when useJobType_ is false */ - private static final double SERIAL_PROB = 0.244; - private static final double POW2_PROB = 0.576; - private static final double ULOW = 0.8f; // The smallest parallel job is 2 nodes - private static final double UMED = 4.5f; - private static final double UHI = 7f; // SYSTEM SIZE is 2^UHI == 128 - private static final double UPROB = 0.86; + public static final double SERIAL_PROB = 0.244; + public static final double POW2_PROB = 0.576; + public static final double ULOW = 0.8f; // The smallest parallel job is 2 nodes + public static final double UMED = 4.5f; + public static final double UHI = 7f; // SYSTEM SIZE is 2^UHI == 128 + public static final double UPROB = 0.86; - private static final double A1 = 4.2; - private static final double B1 = 0.94; - private static final double A2 = 312; - private static final double B2 = 0.03; - private static final double PA = -0.0054; - private static final double PB = 0.78; + public static final double A1 = 4.2; + public static final double B1 = 0.94; + public static final double A2 = 312; + public static final double B2 = 0.03; + public static final double PA = -0.0054; + public static final double PB = 0.78; - private static final double AARR = 10.2303; - private static final double BARR = 0.4871; - private static final double ANUM = 8.1737; - private static final double BNUM = 3.9631; - private static final double ARAR = 1.0225; + public static final double AARR = 10.2303; + public static final double BARR = 0.4871; + public static final double ANUM = 8.1737; + public static final double BNUM = 3.9631; + public static final double ARAR = 1.0225; // start the simulation at midnight (hour 0) private static final int START = 0; @@ -515,13 +685,15 @@ barr[BATCH_JOBS] = barr[INTERACTIVE_JOBS] = BARR; anum[BATCH_JOBS] = anum[INTERACTIVE_JOBS] = ANUM; bnum[BATCH_JOBS] = bnum[INTERACTIVE_JOBS] = BNUM; + + timeFromBegin_[BATCH_JOBS] = Long.MAX_VALUE; } // if ( ! useJobType_ ) // make all jobs batch // timeFromBegin_[INTERACTIVE_JOBS] = Long.MAX_VALUE; - if ( ! useJobType_ ) // make all jobs interactive - timeFromBegin_[BATCH_JOBS] = Long.MAX_VALUE; +// if ( ! useJobType_ ) // make all jobs interactive +// timeFromBegin_[BATCH_JOBS] = Long.MAX_VALUE; } /** @@ -760,17 +932,25 @@ } /** - * Sets the parameters for the inter-arrival time - * The inter-arriving time is calculated using two gamma distributions. - * gamma(aarr,barr) represents the inter_arrival time for the rush hours. - * It is independent on the hour the job arrived at. - * The cdf of gamma(bnum,anum) represents the proportion of number of jobs - * which arrived at each time interval (bucket). - * The inter-arrival time is calculated using both gammas - * Since gamma(aarr,barr) represents the arrive-time at the rush time, - * we use a constant, ARAR (Arrive-Rush-All-Ratio), to set the alpha - * parameter (the new aarr) so it will represent the arrive-time at all - * hours of the day. + * Sets the parameters for the inter-arrival time. <br> + * The inter-arrival time is calculated using two gamma distributions. + * gamma(aarr,barr) represents the inter-arrival time for the rush hours. + * It is independent on the hour the job arrived at. The cdf of + * gamma(bnum,anum) represents the proportion of number of jobs which + * arrived at each time interval (bucket). The inter-arrival time is + * calculated using both gammas. Since gamma(aarr,barr) represents the + * arrival-time at the rush time, we use a constant, ARAR + * (Arrive-Rush-All-Ratio), to set the alpha parameter (the new aarr) + * so it will represent the arrive-time at all hours of the day. + * @param jobType the type of job for which the inter-arrival parameters + * will be modified. + * @param aarr the first parameter for gamma(aarr,barr) distribution + * @param barr the second parameter for gamma(aarr,barr) distribution + * @param anum the first parameter for gamma(bnum,anum) distribution + * @param bnum the second parameter for gamma(bnum,anum) distribution + * @param arar Arrive-Rush-All-Ratio + * @return <tt>true</tt> if the parameters have been set; + * <tt>false</tt> if they have not been set. */ public boolean setInterArrivalTimeParameters(int jobType, double aarr, double barr, double anum, double bnum, double arar) { @@ -842,7 +1022,7 @@ * The workload model will stop when it approaches workloadDuration. * @param workloadDuration the maximum duration of the workload. * @return <tt>true</tt> if the duration has been set; - * <tt>false</tt> othwerwise. + * <tt>false</tt> otherwise. */ public boolean setMaximumWorkloadDuration(double workloadDuration) { if(workloadDuration <= 0) @@ -1153,8 +1333,10 @@ par = twoStageUniform(uLow, uMed, uHi, uProb); if (u <= (serialProb + pow2Prob)) // power of 2 nodes parallel job par = (int)(par + 0.5); // par = round(par) - - return (int)(Math.pow(2, par) + 0.5); // return round(2^par) + + int numNodes = (int)(Math.pow(2, par) + 0.5); // round(2^par) + int maxNodes = (int)(Math.pow(2, uHi) + 0.5); + return numNodes <= maxNodes ? numNodes : maxNodes; } /* @@ -1345,9 +1527,9 @@ } - // --- Methods required by the distributions used by the workload model --- - // --- Most of these methods were ported from C to Java, but the logic --- - // --- remains the same as in Lublin's workload model in C --- + // --- Methods required by the distributions used by the workload model --- + // --- Most of these methods were ported from C to Java, but the logic --- + // --- remains the same as in Lublin's workload model in originally in C --- /* * hyperGamma returns a value of a random variable of mixture of two @@ -1421,22 +1603,6 @@ return (beta * x * y); } -// /* -// * betarndLess1 returns a value of a random variable of beta(alpha,beta) -// * distribution where both alpha and beta are smaller than 1 (and larger -// * than 0) -// */ -// private double betarndLess1(double alpha, double beta) { -// double x, y, u1, u2; -// do { -// u1 = random_.nextDouble(); -// u2 = random_.nextDouble(); -// x = Math.pow(u1, 1 / alpha); -// y = Math.pow(u2, 1 / beta); -// } while (x + y > 1); -// return (x / (x + y)); -// } - /* * betarndLess1 returns a value of a random variable of beta(alpha,beta) * distribution where both alpha and beta are smaller than 1 (and larger @@ -1543,38 +1709,51 @@ return tsu; } +// /* +// * Natural logarithm of gamma function +// */ +// static double logGamma(double x) { +// double tmp = (x - 0.5) * Math.log(x + 4.5) - (x + 4.5); +// double ser = 1.0 + 76.18009173 / (x + 0) - 86.50532033 / (x + 1) +// + 24.01409822 / (x + 2) - 1.231739516 / (x + 3) +// + 0.00120858003 / (x + 4) - 0.00000536382 / (x + 5); +// return tmp + Math.log(ser * Math.sqrt(2 * Math.PI)); +// } + + private double A[] = { + 8.11614167470508450300E-4, + -5.95061904284301438324E-4, + 7.93650340457716943945E-4, + -2.77777777730099687205E-3, + 8.33333333333331927722E-2 }; + + private double B[] = { + -1.37825152569120859100E3, + -3.88016315134637840924E4, + -3.31612992738871184744E5, + -1.16237097492762307383E6, + -1.72173700820839662146E6, + -8.53555664245765465627E5 }; + + private double C[] = { + // 1.00000000000000000000E0, + -3.51815701436523470549E2, + -1.70642106651881159223E4, + -2.20528590553854454839E5, + -1.13933444367982507207E6, + -2.53252307177582951285E6, + -2.01889141433532773231E6 }; + /* * Natural logarithm of gamma function * Cephes Math Library Release 2.2: July, 1992 * Copyright 1984, 1987, 1989, 1992 by Stephen L. Moshier * Direct inquiries to 30 Frost Street, Cambridge, MA 02140 */ - static private double logGamma(double x) + private double logGamma(double x) throws ArithmeticException { double p, q, w, z; - double A[] = { 8.11614167470508450300E-4, - -5.95061904284301438324E-4, - 7.93650340457716943945E-4, - -2.77777777730099687205E-3, - 8.33333333333331927722E-2 }; - - double B[] = { -1.37825152569120859100E3, - -3.88016315134637840924E4, - -3.31612992738871184744E5, - -1.16237097492762307383E6, - -1.72173700820839662146E6, - -8.53555664245765465627E5 }; - - double C[] = { - // 1.00000000000000000000E0, - -3.51815701436523470549E2, - -1.70642106651881159223E4, - -2.20528590553854454839E5, - -1.13933444367982507207E6, - -2.53252307177582951285E6, - -2.01889141433532773231E6 }; - if (x < -34.0) { q = -x; w = logGamma(q); @@ -1631,7 +1810,7 @@ return q; } - static private double polevl(double x, double coef[], int N) + private double polevl(double x, double coef[], int N) throws ArithmeticException { double ans; ans = coef[0]; @@ -1641,7 +1820,7 @@ return ans; } - static private double p1evl(double x, double coef[], int N) + private double p1evl(double x, double coef[], int N) throws ArithmeticException { double ans; ans = x + coef[0]; Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/SSGridlet.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/SSGridlet.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/SSGridlet.java 2008-06-13 00:55:20 UTC (rev 183) @@ -411,7 +411,7 @@ /** * Gets the submission or arrival time of this Gridlet from * the latest GridResource - * @return the submission time or <tt>0.0</tt> if nono + * @return the submission time or <tt>0.0</tt> if none */ public double getSubmissionTime() { return gridlet_.getSubmissionTime(); Modified: branches/gridsim4.0-branch3/source/gridsim/turbo/WorkloadInterface.java =================================================================== --- branches/gridsim4.0-branch3/source/gridsim/turbo/WorkloadInterface.java 2008-05-30 16:57:03 UTC (rev 182) +++ branches/gridsim4.0-branch3/source/gridsim/turbo/WorkloadInterface.java 2008-06-13 00:55:20 UTC (rev 183) @@ -1,6 +1,6 @@ /* * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation + * Description: GridSim (Grid Simulation) Toolkit for Modelling and Simulation * of Parallel and Distributed Systems such as Clusters and Grids * Licence: GPL - http://www.gnu.org/copyleft/gpl.html */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |