www.pudn.com > ghs1.2.rar > paratime.cpp
/* * Copyright (c) 2000-2003 Illinois Institute of Technology. * All rights reserved. * * This file is part of the GHS software package. For license * information, see the LICENSE file in the top level directory of the * GHS source distribution. * * Released Date: August 18 2005 * This is the GHS I release by the * SCS Group, * http://www.cs.iit.edu/~scs * Department of Computer Science, * Illinois Institute of Technology. * * This release has been tested under SUN OS 5.9. * * Supervisor * ---------- * Illiniois Institute of Technology: * -Dr. Xian-He Sun * * Author(s) * ----------------- * Illinois Institute of Technology: * -Ming Wu * -Xian-He Sun * */ #include#include #include #include #include #include #include "ghs.h" using namespace std; extern double GammaCDF(double x, double a, double b); int ptWsNum; vector ptUtil, ptArri, ptServSTD, ptWork; vector a, b; void ReadTaskPara(const vector & ut, const vector & ar, const vector & ss, const vector & wo, int mNum) { ptWsNum = mNum; ptUtil.clear(); ptArri.clear(); ptServSTD.clear(); ptWork.clear(); for (int i = 0; i < ptWsNum; i++) { ptUtil.push_back(ut[i]); ptArri.push_back(ar[i]); ptServSTD.push_back(ss[i]); ptWork.push_back(wo[i]); //cout << ptUtil[i] << " " < migrTime) maxTemp = sWork1; else maxTemp = migrTime; if ( taskTime >= maxTemp) { elambda = exp(-sArri * sWork1); skCDF = elambda + (1 - elambda) * GetSkCDF(aTemp, bTemp, sWork1, taskTime); } else { skCDF = 0; } //cout << "the new skCDF for " << sWork1 <<" and " << migrTime << " and " << taskTime << "is " << skCDF <