Skip to content

Commit 841df7c

Browse files
author
A-lamo
committed
Edit: Playing with syntax and trying to fix unclear behaviour with QNodeEditor.
1 parent 5b903d5 commit 841df7c

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

src/ariel/viz/gui/viewer/main_window.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from PyQt5.QtWidgets import QPushButton, QGraphicsProxyWidget
2222
from PyQt5.QtWidgets import QLineEdit, QComboBox
2323
from QNodeEditor.node import Node
24+
from QNodeEditor import Node, NodeEditorDialog
2425

2526
# ENUMS as a base
2627

@@ -32,15 +33,14 @@
3233
# ========================
3334
# Node Editor Components
3435
# ========================
35-
from QNodeEditor import Node, NodeEditorDialog
36-
from QNodeEditor.node import Node
3736

37+
# The extractor used is what should be specificied in this case I guess
3838
class PhenotypeNode(Node):
3939
code = 111
4040

4141
def create(self):
4242
self.title = "Select Phenotype"
43-
self.add_combo_box_entry("Phenotype", items=["CPG", "FFNN", "CTRNN"])
43+
self.add_combo_box_entry("Phenotype", items=["RoboGen-robot", "Integer-Solution"])
4444
self.add_label_output("Selected Phenotype")
4545

4646
def evaluate(self, values: dict):
@@ -53,7 +53,7 @@ class GenotypeNode(Node):
5353

5454
def create(self):
5555
self.title = "Select Genotype"
56-
self.add_combo_box_entry("Genotype", items=["Integer", "Compositional Pattern Producing Network (CPPN)"])
56+
self.add_combo_box_entry("Genotype", items=["HighProbEncoding", "IntegerEncoding"])
5757
self.add_label_output("Selected Genotype")
5858

5959
def evaluate(self, values: dict):
@@ -84,16 +84,14 @@ def create(self):
8484
def evaluate(self, values: dict):
8585
task = self.entries_dict["Task"].get_value()
8686
self.set_output_value("Selected Task", task)
87+
# print(f"TaskNode selected task: {task}")
8788
return task
8889

8990
class FitnessFunctionNode(Node):
9091
code = 221
9192

92-
task_map = {
93-
"Gate Learning": ["xy_displacement_ff", "x_speed_ff", "y_speed_ff"],
94-
"Targeted Locomotion": ["distance_to_target_ff"],
95-
"Turning In Place": ["turning_in_place_ff"],
96-
}
93+
94+
task_map = _task_fitness_function_map_ # imported above from the actual file
9795

9896
def create(self):
9997
self.title = "Select Fitness Function"
@@ -185,16 +183,12 @@ def create(self):
185183
self.add_value_output("Population Size")
186184
self.add_value_output("Generations")
187185

188-
# # Add line edit entries to actually set them
189-
self.add_value_entry("Population Size", "100")
190-
self.add_value_entry("Generations", "50")
191-
192186
self.entries_dict = {entry.name: entry for entry in self.entries}
193187

194188
def evaluate(self, values: dict):
195189
# Fetch values from line edits
196-
pop_size = int(self.entries_dict["Population Size"].get_value())
197-
generations = int(self.entries_dict["Generations"].get_value())
190+
pop_size = self.entries_dict["Population Size"].get_value()
191+
generations = self.entries_dict["Generations"].get_value()
198192

199193
# Store outputs for input nodes to fetch
200194
self.set_output_value("Population Size", pop_size)

0 commit comments

Comments
 (0)