Tabnine Logo
GraphEntity.getAttributeByName
Code IndexAdd Tabnine to your IDE (free)

How to use
getAttributeByName
method
in
ingenias.generator.browser.GraphEntity

Best Java code snippets using ingenias.generator.browser.GraphEntity.getAttributeByName (Showing top 20 results out of 315)

origin: net.sf.phat/phat-generator

private static boolean hasField(GraphEntity task, String fieldName) {
  GraphAttribute d;
  try {
    d = task.getAttributeByName(fieldName);
  } catch (NotFound ex) {
    return false;
  }
  return true;//d != null && !d.getSimpleValue().equals("");
}
origin: net.sf.phat/phat-generator

private String getSymptomClass(GraphEntity symptom) {
  String result = "Symptom";
  try {
    GraphAttribute typeGA = symptom.getAttributeByName("PDSymptomTypeField");
    String symptType = typeGA.getSimpleValue();
    if (!symptType.equals("")) {
      if (symptType.equals("Tremor")) {
        result = "TremorSymptom";
      }
    }
  } catch (NotFound ex) {
    logger.log(Level.SEVERE, null, ex);
  }
  return result;
}
origin: net.sf.phat/phat-generator

private static String isCanBeInterrupted(GraphEntity task) {
  try {
    GraphAttribute ga = task
        .getAttributeByName("CanBeInterruptedField");
    String value = ga.getSimpleValue();
    if (value.equals("No")) {
      return "false";
    }
  } catch (NotFound e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  return "true";
}
origin: net.sf.phat/phat-generator

public static String getFieldValue(GraphEntity task, String fieldName, String def, boolean mandatory) {
  GraphAttribute at = null;
  try {
    at = task.getAttributeByName(fieldName);
  } catch (NotFound ex) {
  }
  if (at == null || at.getSimpleValue().equals("")) {
    if (mandatory) {
      logger.log(Level.SEVERE, "Attribute {0} of {1} is empty!",
          new Object[]{fieldName, task.getID()});
      System.exit(0);
    } else {
      logger.log(Level.WARNING, "Attribute {0} of {1} is empty!",
          new Object[]{fieldName, task.getID()});
      return def;
    }
  }
  return Utils.getValue(at);
}
origin: net.sf.phat/phat-generator

public static String getADLName(String humanId, Browser browser) throws NotFound {
  GraphEntity ge = getADL(humanId, browser);
  if (ge != null) {
    GraphAttribute ga = ge.getAttributeByName("ADLSpecField");
    if(ga != null && !ga.getSimpleValue().equals("")) {
      return Utils.replaceBadChars(ga.getSimpleValue());
    }
  }
  return null;
}
origin: net.sf.phat/phat-generator

GraphAttribute ga = null;
try {
  ga = ge.getAttributeByName("InteractionSpecDiagField");
  if (ga != null && !ga.getSimpleValue().equals("")) {
    System.out.println("\t-" + ga.getSimpleValue());
      System.out.println("\t-" + interactionGraph.getName());
      for (GraphEntity mle : Utils.getEntities(interactionGraph, "MessageListenedEvent")) {
        GraphAttribute message = mle.getAttributeByName("Message");
        if (!"".equals(message.getSimpleValue())) {
          List<String> words = new ArrayList<>();
origin: net.sf.phat/phat-generator

  public static void linkPDManager(String humanId, Repeat repFather, Browser browser) {
    GraphEntity dmGraph = Utils.getProfileTypeOf(humanId, PARKINSON_PROFILE, browser);
    if (dmGraph != null) {
      try {
        GraphAttribute pdSpec = dmGraph.getAttributeByName("ParkinsonSpecDiag");
        Repeat rep = new Repeat("filterManager");
        repFather.add(rep);
        rep.add(new Var("fmName", Utils.replaceBadChars(pdSpec.getSimpleValue())));
      } catch (NotFound ex) {
        Logger.getLogger(PDGenerator.class.getName()).log(Level.SEVERE, null, ex);
      }
    }
  }
}
origin: net.sf.phat/phat-generator

private String getActorSymptomInSimdiagram(Graph graph, GraphEntity actor, GraphEntity symptom) {
  try {
    for (GraphEntity entity : graph.getEntities()) {
      if (entity.getType().equals("HumanInitialization")
          && Utils.getRelatedElementsVectorInSameDiagram(entity, "RelatedHuman", "RelatedHumantarget").contains(actor)) {
        Vector<GraphEntity> symptomsInitialized = Utils.getRelatedElementsVectorInSameDiagram(entity, "InitializesSymptom", "InitializesSymptomtarget");
        for (GraphEntity symptominialization : symptomsInitialized) {
          boolean initializedSympom = Utils.getRelatedElementsVectorInSameDiagram(symptominialization, "InitializedSymptom", "InitializedSymptomtarget").contains(symptom);
          if (initializedSympom) {
            String levelValue = symptominialization.getAttributeByName("SymptomLevel").getSimpleValue();
            switch (levelValue) {
              case "LOW":
                return "phat.agents.filters.Symptom.Level.LOW";
              case "MEDIUM":
                return "phat.agents.filters.Symptom.Level.MEDIUM";
              case "HIGH":
                return "phat.agents.filters.Symptom.Level.HIGH";
            }
          }
        }
      }
    }
  } catch (NullEntity | NotFound e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  return null;
}
origin: net.sf.phat/phat-generator

public void generateActivities(Graph activitiesSpec, Sequences seq)
    throws NotFound, NullEntity {
  GraphEntity ge = Utils.getFirstEntity(activitiesSpec);
  if (ge.getType().equals("BActivity")) {
    GraphEntity nActivity = Utils.getTargetEntity(ge, "NextActivity");
    if (nActivity == null) {
      return;
    }
    GraphAttribute ga = ge.getAttributeByName("SeqTaskDiagramField");
    Graph taskSpecDiagram = Utils.getGraphByName(ga.getSimpleValue(),
        getBrowser());
    /*if (taskSpecDiagram != null) {
      TaskGenerator taskGenerator = new TaskGenerator(getBrowser(),
          seq);
      taskGenerator.generate("", taskSpecDiagram);
    }*/
  }
}
origin: net.sf.phat/phat-generator

private Vector<Graph> getPDDiagramsForActor(GraphEntity actor) {
  Vector<Graph> patientGraphs = new Vector<Graph>();
  Vector<GraphRelationship> rels = actor.getAllRelationships("ProfileOf");
  for (GraphRelationship rel : rels) {
    GraphEntity target;
    try {
      target = Utils.getSourceEntity(actor, rel);
      if (target.getType().equals("ParkinsonsProfile")) {
        GraphAttribute diagNameAtt = target.getAttributeByName("ParkinsonSpecDiag");
        if (diagNameAtt != null && diagNameAtt.getSimpleValue() != null
            && browser.getGraph(diagNameAtt.getSimpleValue()) != null) {
          patientGraphs.add(browser.getGraph(diagNameAtt.getSimpleValue()));
        }
      }
    } catch (NotFound e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
  return patientGraphs;
}
origin: net.sf.phat/phat-generator

GraphAttribute ga = ip.getAttributeByName("InteractionSpecDiagField");
if (ga == null || ga.getSimpleValue().equals("")) {
  return;
    String eventId = Utils.replaceBadChars(event.getID());
    if (event.getType().equals("VibrateEvent")) {
      GraphAttribute deviceSource = event.getAttributeByName("DeviceSource");
      if (deviceSource == null || deviceSource.getSimpleValue().equals("")) {
        System.exit(-1);
      GraphAttribute state = event.getAttributeByName("DeviceState");
      if (deviceSource == null || deviceSource.getSimpleValue().equals("")) {
        System.exit(-1);
      GraphAttribute deviceSource = event.getAttributeByName("DeviceSource");
      if (deviceSource == null || deviceSource.getSimpleValue().equals("")) {
        System.exit(-1);
      GraphAttribute state = event.getAttributeByName("CallStateField");
      if (deviceSource == null || deviceSource.getSimpleValue().equals("")) {
        System.exit(-1);
      GraphAttribute message = event.getAttributeByName("Message");
      if (message == null || message.getSimpleValue().equals("")) {
        System.exit(-1);
origin: net.sf.phat/phat-generator

public void generateWorldInitialization(String simId, Graph simDiags,
    Repeat rep) throws NullEntity, NotFound {
  GraphEntity ge = getEntity(simDiags, "WorldInitialization");
  GraphAttribute seedworld = ge.getAttributeByName("SimulationSeedField");
  GraphAttribute houseType = ge.getAttributeByName("HouseTypeField");
  String houseTypeString = "House3room2bath";
  if (houseType != null && !houseType.getSimpleValue().equals("")) {
    System.out.println("Hola");
  GraphAttribute year = iniDate.getAttributeByName("YearField");
  GraphAttribute month = iniDate.getAttributeByName("MonthField");
  GraphAttribute day = iniDate.getAttributeByName("DayField");
  GraphAttribute hour = iniDate.getAttributeByName("HourField");
  GraphAttribute min = iniDate.getAttributeByName("MinuteField");
  GraphAttribute sec = iniDate.getAttributeByName("SecondField");
    GraphAttribute width = ge.getAttributeByName("CamWidth");
    GraphAttribute height = ge.getAttributeByName("CamHeight");
origin: net.sf.phat/phat-generator

String front = "true";
GraphAttribute distanceGA = hi.getAttributeByName("DistanceToTarget");
if (distanceGA != null && !distanceGA.getSimpleValue().equals("")) {
  distance = distanceGA.getSimpleValue();
GraphAttribute elevationGA = hi.getAttributeByName("Elevation");
if (elevationGA != null && !elevationGA.getSimpleValue().equals("")) {
  elevation = elevationGA.getSimpleValue();
GraphAttribute frontGA = hi.getAttributeByName("IsInFrontOfHuman");
if (frontGA != null && !frontGA.getSimpleValue().equals("")) {
  if (frontGA.getSimpleValue().equals("No")) {
origin: net.sf.phat/phat-generator

try {
  GraphAttribute sd = sp
      .getAttributeByName("SocialSpecDiagField");
  if (sd.getSimpleValue() != null) {
    System.out.println("Diagram name = "
    if (pi != null) {
      GraphAttribute ageAt = pi
          .getAttributeByName("AgeField");
      if (ageAt != null
          && !ageAt.getSimpleValue().equals("")) {
origin: net.sf.phat/phat-generator

  return;
GraphAttribute ga = adl.getAttributeByName("ADLSpecField");
if (ga == null || ga.getSimpleValue().equals("")) {
  return;
      if (geClock != null) {
        GraphAttribute gaHours = geClock
            .getAttributeByName(HOURS_FIELD);
        int hours = Integer.parseInt(gaHours.getSimpleValue());
        GraphAttribute gaMins = geClock
            .getAttributeByName("MinutesField");
        int mins = Integer.parseInt(gaMins.getSimpleValue());
        GraphAttribute gaSecs = geClock
            .getAttributeByName(SECS_FIELD);
        int secs = Integer.parseInt(gaSecs.getSimpleValue());
        System.out.println(geClock.getID() + ": " + hours + ":"
origin: net.sf.phat/phat-generator

public void generateActivityClasses(Sequences seq) throws NullEntity,
    NotFound {
  for (GraphEntity ge : browser.getAllEntities()) {
    if (ge.getType().equals(ACTIVITY_TYPE)) {
      GraphAttribute ga = ge
          .getAttributeByName(SEQ_TASK_DIAGRAM_FIELD);
      if (ga != null) {
        String actDiagId = Utils.replaceBadChars(ga.getSimpleValue());
        if (actDiagId != null && !actDiagId.equals("")) {
          Repeat rep = new Repeat("activities");
          seq.addRepeat(rep);
          rep.add(new Var("aID", Utils.replaceBadChars(ge.getID())));
          rep.add(new Var("aType", Utils.replaceBadChars(ge.getType())));
          rep.add(new Var("aDesc", Utils.getAttributeByName(ge, "Description")));
          rep.add(new Var("stID", Utils.replaceBadChars(actDiagId)));
          continue;
        }
      }
      logger.log(Level.SEVERE, "The {0} activity doesn't have sequential task diagram!",
          new Object[]{ge.getID()});
      System.exit(0);
    }
  }
}
origin: net.sf.phat/phat-generator

private void generateDeviceAgentsInitialization(Graph simDiag, Repeat simInitRep)
    throws NullEntity, NotFound {
  for (GraphEntity progPool : Utils.getEntities(simDiag, INIT_PROGRAM_POOL)) {
    for (GraphEntity deviceEntity : Utils.getTargetsEntity(progPool, "device")) {
      Repeat importADLRep = new Repeat("importDevices");
      simInitRep.add(importADLRep);
      String deviceId = deviceEntity.getID();
      Repeat agentRep = new Repeat("deviceAgentRep");
      simInitRep.add(agentRep);
      simInitRep.add(new Var("daID", deviceId));
      GraphCollection gc = progPool.getAttributeByName("ProgramPoolField").getCollectionValue();
      for (int i = 0; i < gc.size(); i++) {
        String progId = gc.getElementAt(i).getAttributeByName("modelID").getSimpleValue();
        Repeat progRep = new Repeat("progsRep");
        progRep.add(new Var("progId", progId));
        agentRep.add(progRep);
      }
    }
  }
}
origin: net.sf.phat/phat-generator

if (geClock != null) {
  GraphAttribute gaHours = geClock
      .getAttributeByName(HOURS_FIELD);
  int hours = Integer.parseInt(gaHours.getSimpleValue());
  GraphAttribute gaMins = geClock
      .getAttributeByName("MinutesField");
  int mins = Integer.parseInt(gaMins.getSimpleValue());
  GraphAttribute gaSecs = geClock
      .getAttributeByName(SECS_FIELD);
  int secs = Integer.parseInt(gaSecs.getSimpleValue());
  System.out.println(geClock.getID() + ": " + hours + ":"
origin: net.sf.phat/phat-generator

seq.addRepeat(rep);
GraphAttribute ga = ge
    .getAttributeByName(ACTIVITY_SPEC_FIELD);
if (ga != null) {
  String actDiagId = ga.getSimpleValue();
origin: net.sf.phat/phat-generator

if (stages.size() == 1) {
  GraphEntity stageGE = stages.get(0);
  GraphAttribute stageGA = stageGE.getAttributeByName("NamePDStageField");
  rep.add(new Var("stageName", stageGA.getSimpleValue()));
  for (GraphEntity symptom : Utils.getTargetsEntity(stageGE, SYMPTOMS)) {
      filterSet.add(new Var("symplevel", level));
      if (level != null) {
        GraphAttribute filters = filter.getAttributeByName(TASK_ALLOWED);
        GraphCollection filterCollection = filters.getCollectionValue();
        for (int i = 0; i < filterCollection.size(); i++) {
          GraphEntity ge = filterCollection.getElementAt(i);
          GraphAttribute filterRef = ge.getAttributeByName("modelID");
          String filterDiagName = filterRef.getSimpleValue();
          Graph filtersGraph = Utils.getGraphByName(filterDiagName, browser);
ingenias.generator.browserGraphEntitygetAttributeByName

Popular methods of GraphEntity

  • getID
  • getType
  • getAllAttrs
  • getAllRelationships
  • getRelationships

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ImageIO (javax.imageio)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now