Create and add a new variant based on this subject.

@param ParameterSet $parameterSet
@param int $revolutions
@param int $warmup

@return Variant.
556869
public function createVariant(ParameterSet $parameterSet, $revolutions, $warmup, array $computedStats = [])
    {
        $variant = new Variant(
            $this,
            $parameterSet,
            $revolutions,
            $warmup,
            $computedStats
        );
        $this->variants[] = $variant;

        return $variant;
    }
1029281
public function build($returnClass, array $config, array $params)
  {
    $returnClass = $this->getObjectInstance($returnClass);
    foreach ($config as $configuration)
    {
      if (!$configuration instanceof Configuration)
      {
        throw new TransformerException(
          'Parameter "config" have to be an array of Configuration-Objects!'
        );
      }
      if (!$params[$configuration->getKey()] instanceof Parameter)
      {
        throw new TransformerException(
          'Parameter "params" have to be an array of Parameter-Objects!'
        );
      }
      $this->setValue($returnClass, $configuration, $params[$configuration->getKey()]);
    }

    return $returnClass;
  }
1186151
public function createMethod($name, $params = array(), $body = NULL, $modifiers = GMethod::MODIFIER_PUBLIC) {
    $method = new GMethod($name, $params, $body, $modifiers);
    $this->addMethod($method);
    return $method;
  }
456991
def insertVariantAnnotationSet(self, variantAnnotationSet):
        
        analysisJson = json.dumps(
            protocol.toJsonDict(variantAnnotationSet.getAnalysis()))
        try:
            models.Variantannotationset.create(
                id=variantAnnotationSet.getId(),
                variantsetid=variantAnnotationSet.getParentContainer().getId(),
                ontologyid=variantAnnotationSet.getOntology().getId(),
                name=variantAnnotationSet.getLocalId(),
                analysis=analysisJson,
                annotationtype=variantAnnotationSet.getAnnotationType(),
                created=variantAnnotationSet.getCreationTime(),
                updated=variantAnnotationSet.getUpdatedTime(),
                attributes=json.dumps(variantAnnotationSet.getAttributes()))
        except Exception as e:
            raise exceptions.RepoManagerException(e)
108752
public function setMasterVariant(VariantInterface $masterVariant)
    {
        $masterVariant->setMaster(true);

        /** @var VariantInterface $variant */
        foreach ($this->variants as $variant) {
            if ($variant->isMaster() && $variant !== $masterVariant) {
                $variant->setMaster(false);
            }
        }

        if (!$this->variants->contains($masterVariant)) {
            $masterVariant->setObject($this);
            $this->variants->add($masterVariant);
        }

        return $this;
    }
1098415
private void addToSpanNotSet(int c) {
        if (Utility.sameObjects(spanNotSet, null) || Utility.sameObjects(spanNotSet, spanSet)) {
            if (spanSet.contains(c)) {
                return; // Nothing to do.
            }
            spanNotSet = spanSet.cloneAsThawed();
        }
        spanNotSet.add(c);
    }
1347995
public function create(MapsEngine_Table $postBody, $optParams = array())
  {
    $params = array('postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('create', array($params), "MapsEngine_Table");
  }
329640
def insertVariantSet(self, variantSet):
        
        # We cheat a little here with the VariantSetMetadata, and encode these
        # within the table as a JSON dump. These should really be stored in
        # their own table
        metadataJson = json.dumps(
            [protocol.toJsonDict(metadata) for metadata in
             variantSet.getMetadata()])
        urlMapJson = json.dumps(variantSet.getReferenceToDataUrlIndexMap())
        try:
            models.Variantset.create(
                id=variantSet.getId(),
                datasetid=variantSet.getParentContainer().getId(),
                referencesetid=variantSet.getReferenceSet().getId(),
                name=variantSet.getLocalId(),
                created=datetime.datetime.now(),
                updated=datetime.datetime.now(),
                metadata=metadataJson,
                dataurlindexmap=urlMapJson,
                attributes=json.dumps(variantSet.getAttributes()))
        except Exception as e:
            raise exceptions.RepoManagerException(e)
        for callSet in variantSet.getCallSets():
            self.insertCallSet(callSet)
984596
public static OmsEpanetParametersOptions createFromMap( HashMap<OptionParameterCodes, String> options ) throws Exception {
        OmsEpanetParametersOptions epOptions = new OmsEpanetParametersOptions();
        String units = options.get(OptionParameterCodes.UNITS);
        epOptions.units = units;
        String headloss = options.get(OptionParameterCodes.HEADLOSS);
        epOptions.headloss = headloss;
        String quality = options.get(OptionParameterCodes.QUALITY);
        epOptions.quality = quality;
        String viscosity = options.get(OptionParameterCodes.VISCOSITY);
        epOptions.viscosity = NumericsUtilities.isNumber(viscosity, Double.class);
        String diffusivity = options.get(OptionParameterCodes.DIFFUSIVITY);
        epOptions.diffusivity = NumericsUtilities.isNumber(diffusivity, Double.class);
        String specGravity = options.get(OptionParameterCodes.SPECIFICGRAVITY);
        epOptions.specificGravity = NumericsUtilities.isNumber(specGravity, Double.class);
        String trials = options.get(OptionParameterCodes.TRIALS);
        epOptions.trials = NumericsUtilities.isNumber(trials, Integer.class);
        String accuracy = options.get(OptionParameterCodes.ACCURACY);
        epOptions.accuracy = NumericsUtilities.isNumber(accuracy, Double.class);
        String unbalanced = options.get(OptionParameterCodes.UNBALANCED);
        epOptions.unbalanced = unbalanced;
        String pattern = options.get(OptionParameterCodes.PATTERN);
        epOptions.pattern = NumericsUtilities.isNumber(pattern, Integer.class);
        String demandMultiplier = options.get(OptionParameterCodes.DEMANDMULTIPLIER);
        epOptions.demandMultiplier = NumericsUtilities.isNumber(demandMultiplier, Double.class);
        String emitterExp = options.get(OptionParameterCodes.EMITEXPON);
        epOptions.emitterExponent = NumericsUtilities.isNumber(emitterExp, Double.class);
        String tolerance = options.get(OptionParameterCodes.TOLERANCE);
        epOptions.tolerance = NumericsUtilities.isNumber(tolerance, Double.class);
        epOptions.process();
        return epOptions;
    }
1323933
public Multiset<O> difference(Multiset<O> multiset) throws ParameterException {
		Validate.notNull(multiset);
		Multiset<O> result = new Multiset<>();
		for (O o : support()) {
			if (multiset.multiplicity(o) > 0) {
				result.setMultiplicity(o, Math.max(0, multiplicity(o) - multiset.multiplicity(o)));
			} else {
				result.setMultiplicity(o, multiplicity(o));
			}
		}
		return result;
	}
19638
function (name, params) {
                var newInstance = Object.create(BABYLON.Tools.Instantiate("BABYLON." + name).prototype);
                newInstance.constructor.apply(newInstance, params);
                return newInstance;
            }
1035824
protected function newFacade()
    {
        if (null === $this->facadeClass) {
            throw new FacadeClassNotSetException();
        }

        $facade = new $this->facadeClass();

        if (!$facade instanceof FacadeInterface) {
            throw new TransformerParameterTypeException();
        }

        return $facade;
    }
827958
public void writeParameterSet(ParameterSet params) throws IOException {
        int len = params.getSerializedSize();
        growIfNeeded(len);
        params.flattenToBuffer(buffer.b());
    }
591997
public function addParameters(Parameter ...$parameters): MutableQuery
    {
        $cloned = clone $this;

        $activeParameters = iterator_to_array($this->parameters);
        $activeParameters = array_merge($activeParameters, $parameters);

        $cloned->parameters = new ParameterCollection(...$activeParameters);

        return $cloned;
    }
977529
public function prepend(Dataset $dataset) : self
    {
        if (!$dataset instanceof Labeled) {
            throw new InvalidArgumentException('Can only merge with a labeled'
                . 'dataset.');
        }

        $samples = array_merge($dataset->samples(), $this->samples);
        $labels = array_merge($dataset->labels(), $this->labels);

        return self::quick($samples, $labels);
    }
1280433
public static Map<String, VariantSet> concatVariants(Map<String, VariantSet> variantSet1,
			Map<String, VariantSet> variantSet2) {

		Map<String, VariantSet> result = new HashMap<>();
		if (!isEmpty(variantSet1) && isEmpty(variantSet2)) {
			result.putAll(variantSet1);
		} else if (isEmpty(variantSet1) && !isEmpty(variantSet2)) {
			result.putAll(variantSet2);
		} else if (!isEmpty(variantSet1) && !isEmpty(variantSet2)) {

			Set<String> keySet = new HashSet<>();
			keySet.addAll(variantSet1.keySet());
			keySet.addAll(variantSet2.keySet());
			for (String variantType : keySet) {
				VariantSet variants1 = variantSet1.get(variantType);
				VariantSet variants2 = variantSet2.get(variantType);
				Set<String> variants = new HashSet<>();
				String defaultVariant = null;

				if (variants1 != null && variants2 != null && !variants1.hasSameDefaultVariant(variants2)) {
					throw new BundlingProcessException("For the variant type '" + variantType
							+ "', the variant sets defined in your bundles don't have the same default value.");
				}

				if (variants1 != null) {
					variants.addAll(variants1);
					defaultVariant = variants1.getDefaultVariant();
				}
				if (variants2 != null) {
					variants.addAll(variants2);
					defaultVariant = variants2.getDefaultVariant();
				}

				VariantSet variantSet = new VariantSet(variantType, defaultVariant, variants);
				result.put(variantType, variantSet);
			}
		}

		return result;
	}
897497
public function create(MapsEngine_RasterCollection $postBody, $optParams = array())
  {
    $params = array('postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('create', array($params), "MapsEngine_RasterCollection");
  }