Examples of Expression


Examples of edu.cmu.cs.stage3.alice.core.Expression

    manufactureAnyNecessaryDetails();
  }
  private void updateDetails( java.awt.event.MouseEvent mouseEvent ) {
    for( int i=0; i<details.size(); i++ ) {
      Expression detail = (Expression)details.get( i );
      if( detail.name.getStringValue().equals( "x" ) ) {
        ((Variable)detail).value.set( new Double( mouseEvent.getX() ) );
      } else if( detail.name.getStringValue().equals( "y" ) ) {
        ((Variable)detail).value.set( new Double( mouseEvent.getY() ) );
      } else if( detail.name.getStringValue().equals( "what" ) ) {
View Full Code Here

Examples of edu.mit.simile.backstage.model.data.Expression

    o = configNode.get("condition", configNode);
    if (o instanceof Scriptable) {
      Scriptable condition = (Scriptable) o;
     
      String test = Utilities.getString(condition, "test");
      Expression expression = Utilities.getExpression(condition, "expression");
     
      if (test != null && expression != null) {
        lensNode._conditionTest = test;
        lensNode._conditionExpression = expression;
      }
View Full Code Here

Examples of edu.stanford.nlp.ling.tokensregex.types.Expression

    return extractor;
  }

  public Value getValue(String varname)
  {
    Expression expr = (Expression) env.get(varname);
    if (expr != null) {
      return expr.evaluate(env);
    } else {
      throw new RuntimeException("Unable get expression for variable " + varname);
    }
  }
View Full Code Here

Examples of eu.admire.dispel.expressions.Expression

      return Collections.emptyList();
    }
    LocalVariable modelElement = (LocalVariable) view.getElement();
    LinkedList<DispelNodeDescriptor> result = new LinkedList<DispelNodeDescriptor>();
    {
      Expression childElement = modelElement.getInitialValue();
      int visualID = DispelVisualIDRegistry.getNodeVisualID(view,
          childElement);
      if (visualID == BooleanLiteralEditPart.VISUAL_ID) {
        result.add(new DispelNodeDescriptor(childElement, visualID));
      }
View Full Code Here

Examples of eu.admire.dispel.parser.expression.Expression

    {
        switch (context)
        {
        case TUPLE_ELEMENT:
            TupleElementStrategy tupleElement = (TupleElementStrategy)strategy;   
            Expression expression = tupleElement.getExpression();
            mTuple.add(tupleElement.getElementName(), expression);
        }
    }
View Full Code Here

Examples of expression.Expression

    if (e instanceof NotExpression) {
      return (LogicalExpression)((NotExpression)e).arg1();
    }
    // a=>b is (not a or b) so returns return (a and not b)
    else if (e instanceof ImpliesExpression){
      Expression a1 = ((ImpliesExpression)e).arg1();
      LogicalExpression a2 = (LogicalExpression)((ImpliesExpression)e).arg2();
      return new AndExpression(a1,negateCase(a2));
    }
    // returns the negation
    else return new NotExpression(e);
View Full Code Here

Examples of fitnesse.util.Expression

            expression = input.trim();
        }
    }

    private Maybe<String> evaluateAndFormat() {
        Maybe<Double> evaluation = (new Expression(expression)).evaluate();
        if (evaluation.isNothing()) {
            return Maybe.nothingBecause("invalid expression: " + expression);
        }

        Double result = evaluation.getValue();
View Full Code Here

Examples of freemarker.core.ast.Expression

        //        FMLexer token_source = new FMLexer(scs);
        FMLexer token_source = new FMLexer(scs);
        token_source.SwitchTo(FMConstants.EXPRESSION);
        FMParser parser = new FMParser(token_source);
        parser.setTemplate(caller.getTemplate());
        Expression exp = null;
        try {
            exp = parser.Exp();
        } catch (ParseException pe) {
            pe.setTemplateName(caller.getTemplate().getName());
            throw new TemplateException(pe, env);
        }
        return exp.getAsTemplateModel(env);
    }
View Full Code Here

Examples of games.stendhal.common.parser.Expression

    final SpeakerNPC barMaid = (SpeakerNPC) zone.getNPCList().get(0);
    assertThat(barMaid.getName(), is("Siandra"));
    final Engine engine = barMaid.getEngine();
    engine.setCurrentState(ConversationStates.IDLE);

    Sentence sentence = new SentenceImplementation(new Expression("hi", ExpressionType.VERB));
    engine.step(PlayerTestHelper.createPlayer("bob"), sentence);
    assertThat(engine.getCurrentState(), is(ConversationStates.ATTENDING));
    assertThat(getReply(barMaid), is("Hi!"));

    sentence = new SentenceImplementation(new Expression("bye", ExpressionType.VERB));
    engine.step(PlayerTestHelper.createPlayer("bob"), sentence);
    assertThat(engine.getCurrentState(), is(ConversationStates.IDLE));
    assertThat(getReply(barMaid), is("Bye bye!"));
  }
View Full Code Here

Examples of heart.alsvfd.Expression

        System.out.println("THEN ");
       
        for(Decision d: r.getDecisions()){
          System.out.print("\t"+d.getAttribute().getName()+" is set to ");
         
          Expression e = d.getDecision();
          System.out.print(e);
         
        }
        System.out.println();
       
      }
      System.out.println();
      System.out.println("=============================");
     
     
    }
   
   
    StateElement weatherE = new StateElement();
      StateElement activityE = new StateElement();
      StateElement userProfileE = new StateElement();
     
      weatherE.setAttributeName("weather");
      Value rainy = new SimpleSymbolic("rainy", null, 0.6f);
      weatherE.setValue(rainy);
     
      userProfileE.setAttributeName("user_profile");
      SetValue profile = new SetValue();
      Value[] prifleElements  = {
          new SimpleSymbolic("eating",null,0.6f),
          new SimpleSymbolic("culture",null,0.2f),
          new SimpleSymbolic("entertainment", null, 0.8f),
          new SimpleSymbolic("sightseeing",null,0.2f)
          };
      profile.setValues(Arrays.asList(prifleElements));
      userProfileE.setValue(profile);
     
      activityE.setAttributeName("activity");
      SimpleSymbolic walking = new SimpleSymbolic("walking",null,0.8f);
      activityE.setValue(walking);
     
     
     
      State XTTstate = new State();
      XTTstate.addStateElement(activityE);
      XTTstate.addStateElement(weatherE);
      XTTstate.addStateElement(userProfileE);
     
   
    System.out.println("Printing current state");
    State current = HeaRT.getWm().getCurrentState(model);
    for(StateElement se : current){
      System.out.println("Attribute "+se.getAttributeName()+" = "+se.getValue());
    }
      //TODO -
      try{
        HeaRT.fixedOrderInference(model, new String[]{"Recommendations"}
            new Configuration.Builder()
            .setUte(new CertaintyFactorsEvaluator())
            .setInitialState(XTTstate)
            .build());
   
      }catch(UnsupportedOperationException e){
        e.printStackTrace();
      } catch (AttributeNotRegisteredException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
   

    System.out.println("Printing current state (after inference");
    current = HeaRT.getWm().getCurrentState(model);
    for(StateElement se : current){
      System.out.println("Attribute "+se.getAttributeName()+" = "+se.getValue());
    }
   
 
    } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (BuilderException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (UnsupportedOperationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (NotInTheDomainException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (RangeFormatException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
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.