Package jmt.gui.common.distributions

Examples of jmt.gui.common.distributions.Distribution$Parameter


      // Now parses LDStrategy ranges
      Vector<Node> ranges = parseParameterArray(LDParameterArray);
      for (int i = 0; i < ranges.size(); i++) {
        Vector<Node> parameters = parseParameterArray((Element) ranges.get(i));
        int from = Integer.parseInt(findText(((Element) parameters.get(0)).getElementsByTagName(XML_E_SUBPARAMETER_VALUE).item(0)));
        Distribution distr = parseDistribution((Element) parameters.get(1), (Element) parameters.get(2));
        String mean = findText(((Element) parameters.get(3)).getElementsByTagName(XML_E_SUBPARAMETER_VALUE).item(0));
        Object key;
        if (from == 1) {
          // If this is first range
          key = strategy.getAllRanges()[0];
View Full Code Here


    Vector<Node> distributionParameters = parseParameterArray(distr);
    //add the subparameters which are passed to the distribution parameter
    distributionParameters.addAll(parseParameterArray(distrPar));

    // Gets correct instance of distribution
    Distribution dist = engineToGuiDistr.get(classname).clone();
    Element currpar;
    String param_name;
    for (int i = 0; i < distributionParameters.size(); i++) {

      currpar = (Element) distributionParameters.get(i);

      param_name = currpar.getAttribute(XML_A_SUBPARAMETER_NAME);
      //if current parameter is a nested Distribution
      if (currpar.getAttribute(XML_A_SUBPARAMETER_CLASSPATH).equals(distributionContainer)) {

        //parse the currentparameter to get DIRECT subparameters
        Vector<Node> nestedDistr = parseParameterArray(currpar);
        // If distribution is not set, returns null
        Object param_value = null;
        if (nestedDistr.size() == 0) {
          param_value = null;
        } else {
          //parse the nested distribution
          param_value = parseDistribution((Element) nestedDistr.get(0), (Element) nestedDistr.get(1));
          dist.getParameter(param_name).setValue(param_value);
        }

      } else {
        String param_value = findText(currpar.getElementsByTagName(XML_E_SUBPARAMETER_VALUE).item(0));
        dist.getParameter(param_name).setValue(param_value);
      }

      dist.updateCM(); // Updates values of c and mean
    }
    return dist;
  }
View Full Code Here

      boolean stationOk = false;
      for (int j = 0; j < classes.size(); j++) {
        Object thisClass = classes.get(j);
        Object temp = sd.getServiceTimeDistribution(thisStation, thisClass);
        if (temp instanceof Distribution) {
          Distribution distr = (Distribution) temp;
          if (distr.hasMean()) {
            stationOk = true;
            break;
          }
        }
      }
View Full Code Here

    Vector classes = cd.getClassKeys();
    for (int j = 0; j < classes.size(); j++) {
      Object thisClass = classes.get(j);
      Object temp = sd.getServiceTimeDistribution(stationKey, thisClass);
      if (temp instanceof Distribution) {
        Distribution distr = (Distribution) temp;
        if (distr.hasMean()) {
          valid.add(thisClass);
        }
      }
    }
    return valid;
View Full Code Here

    Vector classes = cd.getOpenClassKeys();
    for (int j = 0; j < classes.size(); j++) {
      Object thisClass = classes.get(j);
      Object temp = cd.getClassDistribution(thisClass);
      if (temp instanceof Distribution) {
        Distribution distr = (Distribution) temp;
        if (distr.hasMean()) {
          valid.add(thisClass);
        }
      }
    }
    return valid;
View Full Code Here

      return;
    }
    if (values != null) {
      if (singleClass) {
        Double refST = (Double) ((Vector) values).get(step);
        Distribution distr = (Distribution) stationDef.getServiceTimeDistribution(stationKey, classKey);
        distr.setMean(refST.doubleValue());
      } else {
        //Vector classSet = classDef.getClassKeys();
        for (int i = 0; i < avaibleClasses.size(); i++) {
          Object thisClass = avaibleClasses.get(i);
          double refST = ((ValuesTable) values).getValue(thisClass, step);
          Distribution distr = (Distribution) stationDef.getServiceTimeDistribution(stationKey, thisClass);
          distr.setMean(refST);
        }
      }
    }
  }
View Full Code Here

      avaibleClasses = new Vector<Object>(0, 1);
      for (int i = 0; i < allClasses.size(); i++) {
        Object thisClass = allClasses.get(i);
        Object temp = stationDef.getServiceTimeDistribution(stationKey, thisClass);
        if (temp instanceof Distribution) {
          Distribution distr = (Distribution) temp;
          if (distr.hasMean()) {
            avaibleClasses.add(thisClass);
          }
        }
      }
      values = new ValuesTable(classDef, avaibleClasses, numberOfSteps);
View Full Code Here

   */
  @Override
  public void restoreOriginalValues() {
    if (originalValues != null) {
      if (singleClass) {
        Distribution distr = (Distribution) stationDef.getServiceTimeDistribution(stationKey, classKey);
        Double mean = (Double) originalValues;
        distr.setMean(mean.doubleValue());
      } else {
        Vector values = (Vector) originalValues;
        for (int i = 0; i < avaibleClasses.size(); i++) {
          Object thisClass = avaibleClasses.get(i);
          Distribution distr = (Distribution) stationDef.getServiceTimeDistribution(stationKey, thisClass);
          Double thisValue = (Double) values.get(i);
          distr.setMean(thisValue.doubleValue());
        }
      }
    }
    //modified = false;
  }
View Full Code Here

                SampleOAuth2Provider.generateAccessAndRefreshToken(accessor);
                String redirect_uri = request.getParameter(OAuth2.REDIRECT_URI);
                String state = request.getParameter(OAuth2.STATE);
               
                List<Parameter> list = new ArrayList<Parameter>(5);
                list.add(new Parameter(OAuth2.ACCESS_TOKEN,accessor.accessToken));
                list.add(new Parameter(OAuth2.TOKEN_TYPE,accessor.tokenType));
                list.add(new Parameter(OAuth2.EXPIRES_IN,"3600"));
                if(accessor.scope!=null) list.add(new Parameter(OAuth2.SCOPE,accessor.scope));
                if(state != null){
                    list.add(new Parameter(OAuth2.STATE, state));
                }
               
                redirect_uri = OAuth2.addParametersAsFragment(redirect_uri,list);
                response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
                response.setHeader("Location", OAuth2.decodePercent(redirect_uri));
View Full Code Here

            // test number of parameters
            if (firstParameters.size() == secondParameters.size())
            {
                for (int i = 0; i < firstParameters.size() && sameSignature; i++)
                {
                    final Parameter firstParameter = (Parameter)firstParameters.get(i);
                    final Parameter secondParameter = (Parameter)secondParameters.get(i);

                    // test each parameter's type
                    sameSignature =
                        isEqual(
                            firstParameter.getType(),
                            secondParameter.getType());
                }
            }
            else
            {
                sameSignature = false;
View Full Code Here

TOP

Related Classes of jmt.gui.common.distributions.Distribution$Parameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.