Example usage for java.lang Double MAX_VALUE

List of usage examples for java.lang Double MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Double MAX_VALUE.

Prototype

double MAX_VALUE

To view the source code for java.lang Double MAX_VALUE.

Click Source Link

Document

A constant holding the largest positive finite value of type double , (2-2-52)·21023.

Usage

From source file:edu.oregonstate.eecs.mcplan.domains.voyager.Voyager.java

public static Planet nearest(final Planet target, final List<Planet> ps) {
    double d = Double.MAX_VALUE;
    Planet closest = null;//ww w  .ja  v a2s  .  com
    for (final Planet p : ps) {
        final double dprime = sq_distance(target, p);
        if (dprime < d) {
            d = dprime;
            closest = p;
        }
    }
    return closest;
}

From source file:com.basetechnology.s0.agentserver.field.FloatField.java

public FloatField(SymbolTable symbolTable, String name) {
    this.symbol = new Symbol(symbolTable, name, IntegerTypeNode.one);
    this.label = name;
    minValue = Double.MIN_VALUE;/*from   w ww  .  j av a2 s  .co m*/
    maxValue = Double.MAX_VALUE;
}

From source file:inflor.core.plots.CategoricalNumberAxis.java

public CategoricalNumberAxis(String name, HashMap<Integer, String> lableMap) {
    super(name);/*w  ww .j a va2  s. co m*/
    this.labelMap = lableMap;

    Integer[] yValues = lableMap.keySet().toArray(new Integer[lableMap.size()]);
    double yMin = Double.MAX_VALUE;
    double yMax = Double.MIN_VALUE;

    for (Integer d : yValues) {
        if (d < yMin) {
            yMin = d;
        }
        if (d > yMax) {
            yMax = d;
        }
    }
    this.setRange(new Range(yMin - 0.5, yMax + 0.5));
    NumberFormat formatter = new CategoryNumberFormat(lableMap);
    this.setNumberFormatOverride(formatter);
    this.setTickMarkOutsideLength(2);
}

From source file:com.espertech.esper.regression.db.TestDatabaseQueryResultCache.java

public void testExpireCacheNoPurge() {
    ConfigurationDBRef configDB = getDefaultConfig();
    configDB.setExpiryTimeCache(1.0d, Double.MAX_VALUE);
    tryCache(configDB, 5000, 1000, false);
}

From source file:com.github.pmerienne.cf.recommendation.TopKItemsTest.java

@Test
public void should_sort_recommendations() {
    // Given//from  w  ww.  j  a v a  2 s  . c om
    int maxSize = 10;

    // When
    TopKItems topKItems = new TopKItems(maxSize);
    for (int i = 0; i < maxSize; i++) {
        topKItems.add(new Recommendation(RandomUtils.nextLong(), RandomUtils.nextDouble()));
    }

    // Then
    double previousScore = Double.MAX_VALUE;
    for (Recommendation recommendation : topKItems) {
        assertThat(recommendation.getScore()).isLessThan(previousScore);
        previousScore = recommendation.getScore();
    }
}

From source file:Main.java

private ListView<Person> createLeaderListView(ObservableList<Person> leaders) {
    final ListView<Person> leaderListView = new ListView<>(leaders);
    leaderListView.setPrefWidth(150);/*  www.  java  2  s. c  o  m*/
    leaderListView.setMaxWidth(Double.MAX_VALUE);
    leaderListView.setPrefHeight(150);

    leaderListView.setCellFactory(new Callback<ListView<Person>, ListCell<Person>>() {
        @Override
        public ListCell<Person> call(ListView<Person> param) {
            Tooltip tooltip = new Tooltip();

            ListCell<Person> cell = new ListCell<Person>() {
                @Override
                public void updateItem(Person item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null) {
                        // leadLbl.setText(item.getAliasName());
                        setText(item.getFirstName() + " " + item.getLastName());
                        tooltip.setText(item.getAliasName());
                        setTooltip(tooltip);
                    }
                }
            };
            return cell;
        }
    });

    return leaderListView;
}

From source file:com.basetechnology.s0.agentserver.field.MoneyField.java

public MoneyField(SymbolTable symbolTable, String name) {
    this.symbol = new Symbol(symbolTable, name, IntegerTypeNode.one);
    this.label = name;
    minValue = 0;//from w ww  .  j ava  2  s  .co m
    maxValue = Double.MAX_VALUE;
}

From source file:edu.oregonstate.eecs.mcplan.ml.VoronoiClassifier.java

public int classify(final RealVector x) {
    double best_distance = Double.MAX_VALUE;
    int best_idx = 0;
    for (int i = 0; i < centers_.length; ++i) {
        final double d = distance(x, centers_[i]);
        if (d < best_distance) {
            best_distance = d;//from   w  w  w  . j ava  2s.  c o m
            best_idx = i;
        }
    }
    //      System.out.print( x );
    //      System.out.print( " -> " );
    //      System.out.println( centers_[best_idx] );
    return best_idx;
}

From source file:emlab.domain.agent.CommoditySupplier.java

public double getAmountOfCommodity() {
    return Double.MAX_VALUE;
}

From source file:es.udc.gii.common.eaf.stoptest.cma.CMATolXStopTest.java

@Override
public boolean isReach(EvolutionaryAlgorithm algorithm) {

    double current_tol_x, sigma, minstartsigma, maxsqrtdiagC, pc;
    CMAEvolutionaryAlgorithm cma = (CMAEvolutionaryAlgorithm) algorithm;

    minstartsigma = StatUtils.min(cma.getStartSigma());
    current_tol_x = Math.max(this.tol_x, this.tol_x_factor * minstartsigma);
    maxsqrtdiagC = Math.sqrt(StatUtils.max(cma.diag(cma.getC())));
    sigma = cma.getSigma();//  w  w w .ja  v  a2s .com

    pc = -Double.MAX_VALUE;
    for (double d : cma.getPc()) {
        pc = Math.max(pc, Math.abs(d));
    }

    if (sigma * maxsqrtdiagC < current_tol_x && sigma * pc < current_tol_x) {
        return true;
    }

    return false;

}