Skip to content

Commit

Permalink
Merge pull request #45 from sanctuuary/dev
Browse files Browse the repository at this point in the history
Dev (APE 1.1.4)
  • Loading branch information
vedran-kasalica authored Jan 12, 2021
2 parents 5198246 + 06b5ca3 commit e03cb8b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.sanctuuary</groupId>
<artifactId>APE</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
<packaging>jar</packaging>
<name>io.github.sanctuuary:APE</name>
<description>APE is a command line tool and an API for the automated exploration of possible computational pipelines (workflows) from large collections of computational tools.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import nl.uu.cs.ape.sat.automaton.State;
import nl.uu.cs.ape.sat.models.AbstractModule;
import nl.uu.cs.ape.sat.models.Module;
import nl.uu.cs.ape.sat.models.Type;
import nl.uu.cs.ape.sat.models.enums.WorkflowElement;
import nl.uu.cs.ape.sat.utils.APEUtils;

Expand Down Expand Up @@ -281,4 +282,11 @@ public String getNodeID() {
public String getNodeLabel() {
return this.usedModule.getPredicateLabel();
}

/**
* Gets node descriptive label, containing module IDs.
*/
public String getNodeFullLabel() {
return this.usedModule.getPredicateID();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,21 @@ public int compareTo(SolutionWorkflowNode otherNode) {
/**
* Gets node id.
*
* @return The unique label that describes the node.
* @return The unique ID that identifies the node and should not be used for presentation.
*/
public abstract String getNodeID();

/**
* Gets node full label.
*
* @return A label that describes the node using full type and tool IDs (it is usually much longer than {@link #getNodeLabel()}.
*/
public abstract String getNodeFullLabel();

/**
* Gets node label.
*
* @return A label that describes the node.
* @return A human readable and condensed label that describes the node.
*/
public abstract String getNodeLabel();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import nl.uu.cs.ape.sat.automaton.TypeAutomaton;
import nl.uu.cs.ape.sat.models.Type;
import nl.uu.cs.ape.sat.models.enums.WorkflowElement;
import nl.uu.cs.ape.sat.utils.APEUtils;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -217,10 +218,10 @@ public String getNodeLabel() {
}

/**
* Get id of the current workflow node in .dot representation.
* Get the unique ID of the current workflow node in .dot representation.
*/
public String getNodeID() {
StringBuilder printString = new StringBuilder();
StringBuilder printString = new StringBuilder("\"");

int i = 0;
for (Type type : this.usedTypes) {
Expand All @@ -229,10 +230,30 @@ public String getNodeID() {
printString = printString.append(",");
}
}
printString = printString.append("_").append(super.getAutomatonState().getPredicateID());
printString = printString.append("_").append(super.getAutomatonState().getPredicateID()).append("\"");

return printString.toString();
}

/**
* Gets node descriptive label, containing type IDs.
*/
public String getNodeFullLabel() {
StringBuilder printString = new StringBuilder();
int i = 0;
for (Type type : this.usedTypes) {
String typeLabel = type.getPredicateID();
if(type.isArtificialLeaf()) {
// remove "_plain" suffix
typeLabel = APEUtils.removeNLastChar(typeLabel, 6);
}
printString = printString.append(typeLabel);
if (++i < this.usedTypes.size()) {
printString = printString.append(", ");
}
}
return printString.toString();
}

/**
* Gets short node id.
Expand Down

0 comments on commit e03cb8b

Please sign in to comment.