Examples of EvaluationException


Examples of com.googlecode.prolog_cafe.lang.EvaluationException

    } else if (curUser instanceof AnonymousUser) {
      resultTerm = anonymous;
    } else if (curUser instanceof PeerDaemonUser) {
      resultTerm = peerDaemon;
    } else {
      throw new EvaluationException("Unknown user type");
    }

    if (!a1.unify(new StructureTerm(user, resultTerm), engine.trail)) {
      return engine.fail();
    }
View Full Code Here

Examples of com.sk89q.worldedit.internal.expression.runtime.EvaluationException

        return "UnboundVariable(" + name + ")";
    }

    @Override
    public double getValue() throws EvaluationException {
        throw new EvaluationException(getPosition(), "Tried to evaluate unbound variable!");
    }
View Full Code Here

Examples of com.sk89q.worldedit.internal.expression.runtime.EvaluationException

        throw new EvaluationException(getPosition(), "Tried to evaluate unbound variable!");
    }

    @Override
    public LValue optimize() throws EvaluationException {
        throw new EvaluationException(getPosition(), "Tried to optimize unbound variable!");
    }
View Full Code Here

Examples of com.sk89q.worldedit.internal.expression.runtime.EvaluationException

        throw new EvaluationException(getPosition(), "Tried to optimize unbound variable!");
    }

    @Override
    public double assign(double value) throws EvaluationException {
        throw new EvaluationException(getPosition(), "Tried to assign unbound variable!");
    }
View Full Code Here

Examples of com.sk89q.worldedit.internal.expression.runtime.EvaluationException

    public double evaluate(double... values) throws EvaluationException {
        for (int i = 0; i < values.length; ++i) {
            final String variableName = variableNames[i];
            final RValue invokable = variables.get(variableName);
            if (!(invokable instanceof Variable)) {
                throw new EvaluationException(invokable.getPosition(), "Tried to assign constant " + variableName + ".");
            }

            ((Variable) invokable).value = values[i];
        }
View Full Code Here

Examples of cu.repsystestbed.exceptions.EvaluationException

    {
      Util.assertNotNull(m_alg);
    }
    catch(Exception e)
    {
      throw new EvaluationException("The inner algorithm is not set. ", e);
    }
   
    if(!(m_alg.getGraph2Listen() instanceof FeedbackHistoryGraph))
    {
      throw new EvaluationException("This evaluation needs a FeedbackHistoryGraph as input.");
    }
   
    if(changes != null)
    {
      if(changes.size() < 1)
      {
        throw new EvaluationException("Changes is not null but there are no changes.");
      }
     
      try
      {
        for(FeedbackHistoryGraphEdge fhge : (ArrayList<FeedbackHistoryGraphEdge>) changes)
        {
          EvolData data = dataPoints.remove(getHashCode((Agent)fhge.src, (Agent)fhge.sink));
          if(data == null)
          {
            data = new EvolData(new ArrayList<Double>(), new ArrayList<Double>(),
                new ArrayList<Double>(), new ArrayList<Double>());
          }
         
          Feedback f1 = null, f0 = null;
          double ts1 = Double.MIN_VALUE, ts0 = Double.MIN_VALUE;
         
          if(fhge.feedbacks.size() >= 2)
          {
            f1 = fhge.feedbacks.get(fhge.feedbacks.size() - 1);
            f0 = fhge.feedbacks.get(fhge.feedbacks.size() - 2);
          }
         
          ReputationGraph rg = (ReputationGraph) m_alg.getGraph2Output();
          Util.assertNotNull(rg);
         
          ReputationEdge re = (ReputationEdge) rg.getEdge((Agent) fhge.src, (Agent) fhge.sink);
          Util.assertNotNull(re);
         
          /*
           * It is ok to assume that feedback additions results in change in reputation. So we
           * can do take the first and the last In fact,
           * if this assumption fails, the inner alg does not comply with Marsh's trust evolution
           * conditions.
           */
         
          if(re.getReputationHistory().size() >= 2)
          {
            ts1 = re.getReputationHistory().get(re.getReputationHistory().size() - 1);
            ts0 = re.getReputationHistory().get(re.getReputationHistory().size() - 2);
          }
         
          if(f1 != null && f0 != null && ts1 > Double.MIN_VALUE && ts0 > Double.MIN_VALUE )
          {
            double x = f1.value - f0.value;
            double y = ts1 - ts0;
           
            if(f1.value > f0.value)
            {
              logger.info("feedbacks[i+1] is greater than feedbacks[i]");
              data.m_positiveXPoints.add(x);
              data.m_positiveYPoints.add(y);
            }
            else if(f1.value < f0.value)
            {
              logger.info("feedbacks[i+1] is less than feedbacks[i]");
              data.m_negativeXPoints.add(x);
              data.m_negativeYPoints.add(y);
            }
            else
            {
              logger.info("feedbacks[i+1] = feedbacks[i]");
           
          }
         
          dataPoints.put(getHashCode((Agent)fhge.src, (Agent)fhge.sink), data);
          logger.debug("Data point added. Key=" + getHashCode((Agent)fhge.src, (Agent)fhge.sink) + "Data: " + data);
        }
      }
      catch(ClassCastException e)
      {
        throw new EvaluationException("Changes does not contain a list of FeedbackHistoryGraphEdge. ", e);
      }
    }
    else
    {
      logger.info("No changes passed.");
View Full Code Here

Examples of javax.faces.el.EvaluationException

        {
            return descriptor.getReadMethod().invoke(base, (Object[]) null);
        }
        catch (IllegalAccessException e)
        {
            throw new EvaluationException(e);
        }
        catch (InvocationTargetException e)
        {
            throw new EvaluationException(e.getTargetException());
        }

    }
View Full Code Here

Examples of javax.faces.el.EvaluationException

        {
            descriptor.getWriteMethod().invoke(base, new Object[] { value });
        }
        catch (IllegalAccessException e)
        {
            throw new EvaluationException(e);
        }
        catch (InvocationTargetException e)
        {
            throw new EvaluationException(e.getTargetException());
        }

    }
View Full Code Here

Examples of javax.faces.el.EvaluationException

            info = Introspector.getBeanInfo(clazz);
            System.err.println("  Found BeanInfo " + info);
        }
        catch (IntrospectionException e)
        {
            throw new EvaluationException(e);
        }
        PropertyDescriptor[] descriptors = info.getPropertyDescriptors();
        for (int i = 0; i < descriptors.length; i++)
        {
            if (name.equals(descriptors[i].getName()))
View Full Code Here

Examples of javax.faces.el.EvaluationException

        try {
            return expression.getType(context.getELContext());
        } catch (javax.el.PropertyNotFoundException e) {
            throw new PropertyNotFoundException(e);
        } catch (ELException e) {
            throw new EvaluationException(e);
        }
    }
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.