Examples of Calculable


Examples of de.congrace.exp4j.Calculable

       
        List<Double> results = new ArrayList<Double>();
       
        for (Double p : points)
        {
            Calculable calc = new ExpressionBuilder(equation.getEquation()).withVariable(
                    String.valueOf(equation.getIndependentVariable()), p).build();
            results.add(calc.calculate());
        }
       
        return new Solution(results, 0, 10, 1);
    }
View Full Code Here

Examples of de.congrace.exp4j.Calculable

       
        List<Double> results = new ArrayList<Double>();
       
        for (String f : function)
        {
            Calculable calc = new ExpressionBuilder(f).withVariables(map).build();
            results.add(calc.calculate() * h);
        }
       
        return results;
       
    }
View Full Code Here

Examples of de.congrace.exp4j.Calculable

       
        List<Double> results = new ArrayList<Double>();
       
        for (Double p : points)
        {
            Calculable calc = new ExpressionBuilder(equation.getEquation()).withVariable(
                    String.valueOf(equation.getIndependentVariable()), p).build();
            results.add(calc.calculate());
        }
       
        return new Solution(results, 0, 10, 1);
    }
View Full Code Here

Examples of de.congrace.exp4j.Calculable

       
        List<Double> results = new ArrayList<Double>();
       
        for (String f : function)
        {
            Calculable calc = new ExpressionBuilder(f).withVariables(map).build();
            results.add(calc.calculate() * h);
        }
       
        return results;
    }
View Full Code Here

Examples of de.congrace.exp4j.Calculable

        for (List<String> function : functions)
        {
            List<Double> result = new ArrayList<Double>(function.size());
            for (String f : function)
            {
                Calculable calc = new ExpressionBuilder(f).withVariables(map).build();
                result.add(calc.calculate() * h);
            }
            results.add(result);
        }
       
        return results;
View Full Code Here

Examples of de.congrace.exp4j.Calculable

    @RequestMapping(value = "/evaluate", method = RequestMethod.GET)
    @ResponseBody
    public Map<String, Object> evaluate(HttpServletRequest request) throws UnknownFunctionException, UnparsableExpressionException {
        String query = request.getParameter("query");

        Calculable calc = new ExpressionBuilder(query).build();

        return Collections.singletonMap(query, (Object) calc.calculate());
    }
View Full Code Here

Examples of org.rioproject.watch.Calculable

        }

        public void notify(RemoteServiceEvent event) {
            SLAThresholdEvent slaEvent = (SLAThresholdEvent)event;
            SLA sla = slaEvent.getSLA();
            Calculable c = slaEvent.getCalculable();
            String type = slaEvent.getThresholdType().name();
            System.out.println(type+" current: "+c.getValue()+", low: " + sla.getLowThreshold() + ", high: " + sla.getHighThreshold());
            if(slaEvent.getThresholdType()== ThresholdType.BREACHED) {
                if(c.getValue()>sla.getHighThreshold())
                    upperBreachNotification = true;
                if(c.getValue()<sla.getLowThreshold())
                    lowerBreachNotification = true;
            }
        }
View Full Code Here

Examples of org.rioproject.watch.Calculable

     * @see WatchMBean#getLastCalculableValue
     */
    public double getLastCalculableValue() {
        double value = 0;
        try {
            Calculable lastCalculable;
            if(localRef != null)
                lastCalculable = localRef.getLastCalculable();
            else
                lastCalculable = watchDataSource.getLastCalculable();
            if(lastCalculable != null) {
                value = lastCalculable.getValue();
            }
        } catch(Exception e) {
            logger.warn("Getting last calculable", e);
        }
        return(value);
View Full Code Here

Examples of org.rioproject.watch.Calculable

    public void setElapsedTime(long elapsed, long now) {
        addWatchRecord(new StopWatchCalculable(id, elapsed, now));
    }

    public void setElapsedTime(long elapsed, long now, String detail) {
        Calculable calculable = new StopWatchCalculable(id, elapsed, now);
        calculable.setDetail(detail);
        addWatchRecord(calculable);
    }
View Full Code Here

Examples of org.rioproject.watch.Calculable

        // Go through the checkpoints
        for (int checkpoint : checkpoints) {

            // Generate samples to reach the checkpoint
            while (added.size() < checkpoint) {
                Calculable c = new Calculable(watch.getId(), Math.random(),
                                              added.size());
                if (tryNulls && added.size() % 10 == 3) {
                    c = null;
                }
                added.add(c);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.