-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
945c98b
commit 3be2d4a
Showing
2 changed files
with
55 additions
and
97 deletions.
There are no files selected for viewing
96 changes: 0 additions & 96 deletions
96
similarity/src/main/java/hu/bme/mit/ase/shingler/similarity/SimilarityWorkflow.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
// TODO: create Workflow template! | ||
package hu.bme.mit.ase.shingler.similarity; | ||
|
||
import hu.bme.mit.ase.shingler.workflow.impl.*; | ||
import hu.bme.mit.ase.shingler.workflow.lib.*; | ||
|
||
public class {{ name }}Workflow extends Workflow<Double> { | ||
|
||
// Input pin declarations | ||
{%- for in_pin in inPins %} | ||
public final Pin<String> {{ in_pin.name }} = new Pin<>(); | ||
{%- endfor %} | ||
|
||
// Parameter declarations | ||
{%- for param in parameters %} | ||
private final {{ param.type }} {{ param.name }}; | ||
{%- endfor %} | ||
|
||
public {{ name }}Workflow({% for param in parameters %}{{ param.type }} {{ param.name }}{% if not loop.last %}, {% endif %}{% endfor %}) { | ||
{%- for param in parameters %} | ||
this.{{ param.name }} = {{ param.name }}; | ||
{%- endfor %} | ||
} | ||
|
||
@Override | ||
protected void initialize() { | ||
{%- for worker in workers %} | ||
var {{ worker.name }} = new {{ worker.type }}Worker( | ||
{%- if worker.arguments -%} | ||
{%- for argument in worker.arguments -%} | ||
{{ argument }} | ||
{%- if not loop.last -%}, {% endif -%} | ||
{%- endfor -%} | ||
{%- endif -%} | ||
); | ||
{%- endfor %} | ||
{% for worker in workers %} | ||
addWorker({{ worker.name }}); | ||
{%- endfor %} | ||
|
||
setOutputPin({{ outPin.worker }}.outputPin); | ||
{% for in_pin in inPins %} | ||
var input{{ in_pin.name | capitalize }} = new Channel<>({{ in_pin.name }}, {{ in_pin.worker }}.{{ in_pin.pin }}Pin); | ||
{%- endfor %} | ||
{% for in_pin in inPins %} | ||
addChannel(input{{ in_pin.name | capitalize }}); | ||
{%- endfor %} | ||
{% for channel in channels %} | ||
var {{ channel.name }} = new Channel<>({{ channel.fromWorker }}.outputPin, {{ channel.toWorker }}.{{ channel.toPin }}Pin); | ||
{%- endfor %} | ||
{% for channel in channels %} | ||
addChannel({{ channel.name }}); | ||
{%- endfor %} | ||
} | ||
|
||
} |