@Override public TObjectDoubleMap<String> getRunningMean() { TObjectDoubleMap<String> activityToMeanMap = new TObjectDoubleHashMap<>(); setExecutionTimeRunningMean.setActivityToMeanMap(activityToMeanMap); setExecutionTimeRunningMean.setFactor(1.0 / executionData.size()); runningExecutionTotals.forEachEntry(setExecutionTimeRunningMean); return activityToMeanMap; }
@Override public TObjectDoubleMap<String> getAllocationMean() { TObjectDoubleMap<String> activityToMeanMap = new TObjectDoubleHashMap<>(); setAllocatedMemoryRunningMean.setActivityToMeanMap(activityToMeanMap); setAllocatedMemoryRunningMean.setFactor(1.0 / allocationData.size()); runningAllocationTotals.forEachEntry(setAllocatedMemoryRunningMean); return activityToMeanMap; }
public PerformanceMonitorImpl() { activityStack = Queues.newArrayDeque(); executionData = Lists.newLinkedList(); allocationData = Lists.newLinkedList(); currentExecutionData = new TObjectLongHashMap<>(); currentAllocationData = new TObjectLongHashMap<>(); runningExecutionTotals = new TObjectLongHashMap<>(); runningAllocationTotals = new TObjectLongHashMap<>(); spikeData = new TObjectDoubleHashMap<>(); decayLargestExecutionTime = new DecayerOfActivityLargestExecutionTime(); updateExecutionTimeTotalAndSpikeData = new UpdaterOfActivityExecutionTimeTotalAndSpikeData(); updateAllocatedMemoryTotal = new UpdaterOfActivityAllocatedMemoryTotal(); removeExpiredExecutionTimeValueFromTotal = new RemoverFromTotalOfActivityExpiredExecutionTimeValue(); removeExpiredAllocatedMemoryValueFromTotal = new RemoverFromTotalOfActivityExpiredAllocatedMemoryValue(); setExecutionTimeRunningMean = new SetterOfActivityToRunningMeanMapEntry(); setAllocatedMemoryRunningMean = new SetterOfActivityToRunningMeanMapEntry(); timer = (EngineTime) CoreRegistry.get(Time.class); mainThread = Thread.currentThread(); }
TObjectDoubleMap<Vertex> vertices = new TObjectDoubleHashMap<>(100, 0.5f, Double.POSITIVE_INFINITY); ShortestPathTree spt = new DominanceFunction.MinimumWeight().getNewShortestPathTree(rr);
/** * Creates an empty {@code RationalObjectCounter}. */ public RationalObjectCounter() { counts = new TObjectDoubleHashMap<T>(); sum = 0; }
public FreeRadicalEdgeScorer() { this.freeRadicals = new TObjectDoubleHashMap<MolecularFormula>(50, 0.75f, Double.NEGATIVE_INFINITY); this.generalRadicalScore = 0d; this.normalization = 0d; }
private TObjectDoubleHashMap<Candidate>[] createMap(int length) { TObjectDoubleHashMap[] map = new TObjectDoubleHashMap[length]; for(int i = 0; i < map.length; ++i) { map[i] = new TObjectDoubleHashMap(); } return map; }
AlignmentTree(TreeAdapter<T> adapter) { this.adapter = adapter; this.deletionNodes = new ArrayList<Node<T>>(); this.matchNodes = new ArrayList<Node<T>>(); this.GAP_COSTS_L = new TObjectDoubleHashMap<T>(); this.GAP_COSTS_R = new TObjectDoubleHashMap<T>(); }
public void add(String string1, String string2, double value) { TObjectDoubleMap<String> row = matrix.get(string1); if (row == null) { row = new TObjectDoubleHashMap<String>(); matrix.put(string1, row); } row.put(string2, value); }
private static TObjectDoubleHashMap<MolecularFormula> convertMap(Map<MolecularFormula, Double> map) { final TObjectDoubleHashMap newMap = new TObjectDoubleHashMap<MolecularFormula>(map.size()); for (Map.Entry<MolecularFormula, Double> entry : map.entrySet()) newMap.put(entry.getKey(), entry.getValue()); return newMap; }
private static TObjectDoubleHashMap<MolecularFormula> convertMap(Map<MolecularFormula, Double> map) { final TObjectDoubleHashMap newMap = new TObjectDoubleHashMap<MolecularFormula>(map.size()); for (Map.Entry<MolecularFormula, Double> entry : map.entrySet()) newMap.put(entry.getKey(), entry.getValue()); return newMap; }
TObjectDoubleHashMap<MolecularFormula> getRecombinatedList() { if (recombinatedList == null) recombinatedList = recombinator == null ? new TObjectDoubleHashMap<MolecularFormula>() : recombinator.recombinate(commonLosses, normalization); return recombinatedList; }
public FreeRadicalEdgeScorer(Map<MolecularFormula, Double> freeRadicals, double generalRadicalScore, double normalization) { this.freeRadicals = new TObjectDoubleHashMap<MolecularFormula>(freeRadicals.size() * 2, 0.75f, Double.NEGATIVE_INFINITY); this.freeRadicals.putAll(freeRadicals); this.generalRadicalScore = generalRadicalScore; this.normalization = normalization; }
public void reset() { counts = new TObjectDoubleHashMap<>(); total = 0; argMax = new ArgMax<>(null, Double.MIN_VALUE); argMin = new ArgMin<>(null, Double.MAX_VALUE); stats = new OneVariableStats(); }
public void reset() { counts = new TObjectDoubleHashMap<>(); total = 0; argMax = new ArgMax<>(null, Double.MIN_VALUE); argMin = new ArgMin<>(null, Double.MAX_VALUE); stats = new OneVariableStats(); }
/** * Make a new mapping. * * @param r the resource to consider */ public CShareableResource(ShareableResource r) throws SchedulerException { this.rc = r; this.id = r.getIdentifier(); wantedCapacity = new TObjectIntHashMap<>(); wantedAmount = new TObjectIntHashMap<>(); wantedRatios = new TObjectDoubleHashMap<>(); }
private void refreshCharactersAndCumulativeWeights(int firstDrawn, int secondDrawn) { TObjectDoubleMap<RoaringBitmap> charCandidates = new TObjectDoubleHashMap<>(hyperEdges.length); for (int i = 0; i < hyperEdges.length; i++) { if (!mergeEdgeIfExistsAndCheckIsEmpty(hyperEdges[i], firstDrawn, secondDrawn)) { charCandidates.adjustOrPutValue(hyperEdges[i], weights[i], weights[i]); } } refreshCharacters(charCandidates); }
@Override public TObjectDoubleHashMap<MolecularFormula> recombinate(TObjectDoubleHashMap<MolecularFormula> source, double normalizationConstant) { final TObjectDoubleHashMap<MolecularFormula> recombination = new TObjectDoubleHashMap<MolecularFormula> (source.size()*losses.size()); for (MolecularFormula loss : losses) { for (MolecularFormula f : source.keySet()) { final MolecularFormula recomb = loss.add(f); final double score = source.get(f)+penalty; if (score < 0) continue; if (!source.containsKey(recomb) || source.get(recomb)<score) recombination.put(recomb, score); } } return recombination; }
/** {@inheritDoc} */ @Override public TObjectDoubleHashMap<String> getOrCreateJointHomeConfiguration() { if (jointHomeConfiguration != null) return jointHomeConfiguration; jointHomeConfiguration = new TObjectDoubleHashMap<String>(); for (SpineJointName name : jointMap.getSpineJointNames()) jointHomeConfiguration.put(jointMap.getSpineJointName(name), 0.0); for (NeckJointName name : jointMap.getNeckJointNames()) jointHomeConfiguration.put(jointMap.getNeckJointName(name), 0.0); return jointHomeConfiguration; }
/** {@inheritDoc} */ @Override public TObjectDoubleHashMap<String> getOrCreateJointHomeConfiguration() { if (jointHomeConfiguration != null) return jointHomeConfiguration; jointHomeConfiguration = new TObjectDoubleHashMap<String>(); for (SpineJointName name : jointMap.getSpineJointNames()) jointHomeConfiguration.put(jointMap.getSpineJointName(name), 0.0); for (NeckJointName name : jointMap.getNeckJointNames()) jointHomeConfiguration.put(jointMap.getNeckJointName(name), 0.0); return jointHomeConfiguration; }