@Override
 public double getNextSample(double simTime) {
   double ret = 0.0;
   try {
     ExpResult res = ExpEvaluator.evaluateExpression(exp, simTime, thisEnt);
     if (res.unitType != unitType)
       thisEnt.error(
           "Invalid unit returned by an expression. Received: %s, expected: %s",
           res.unitType.getSimpleName(), unitType.getSimpleName(), "");
     ret = res.value;
   } catch (ExpError e) {
     thisEnt.error("%s", e.getMessage());
   }
   return ret;
 }
Exemple #2
0
  @Override
  public ArrayList<String> getValidOptions() {
    ArrayList<String> list = new ArrayList<>();
    for (V each : Entity.getClonesOfIterator(valClass)) {
      if (each.testFlag(Entity.FLAG_GENERATED)) continue;

      list.add(each.getName());
    }
    Collections.sort(list);
    return list;
  }