AMIOL7 / ELME

Apache License 2.0
0 stars 1 forks source link

Getting the ports for the creation of Custom Nodes #44

Closed bgdxqi closed 1 year ago

bgdxqi commented 1 year ago

A part of creating custom nodes is collecting the free input and output ports, so that the custom node can have ports as well. The function collecting the input ports: getFreeInputPorts .While the output port equivalent is: getFreeOutputPorts. Both function will sort the ports by their node's dependency, going from the lowest to the highest.

AMIOL7 commented 1 year ago

@bgdxqi Since, as we previously discussed, the naming of ports will be automatic, is it possible to have functions also create unique id names for these ports?

AMIOL7 commented 1 year ago

What will be the output of these functions exactly? List, ArrayList, Map?

bgdxqi commented 1 year ago

What will be the output of these functions exactly? List, ArrayList, Map?

As for now, an ArrayList<InputPort> and ArrayList<OutputPort> separately

bgdxqi commented 1 year ago

@bgdxqi Since, as we previously discussed, the naming of ports will be automatic, is it possible to have functions also create unique id names for these ports?

I support the idea! Would be much easier to keep track of the ports. But it needs some tweaking in the View as well. Maybe @vismate or @pszi could tell more.

AMIOL7 commented 1 year ago

I could start working on generating the truth tables, but for that I need a final version of how the output of those functions is going to look like, and where these functions are going to be located

bgdxqi commented 1 year ago

The most of it I think is done. You can check it out in the model-simulation branch -> commit : Returned free ports are now on the order of increasing dependency.

The idea is basically the following: It orders the Nodes from having the least dependency to the most dependency and then cycles through them to get any free ports. The return is an ArrayList<InputPort> and ArrayList<OutputPort> separately. And their order is , as planned, dependency (if they have same dependency, the order of they are in in the ArrayList<Nodes> nodes in ELME.Model.Graph) then the order of the ports in the Nodes (ELME.Model.Node.inputs / ELME.Model.Nide.outputs).

If you have any suggestions, let me know

AMIOL7 commented 1 year ago

But will the output change, if we decide to add names to ports in your function?

bgdxqi commented 1 year ago

It shouldn't. The name of the ports are stored in the ports themselves. Also I don't use their names for anything at the moment.

bgdxqi commented 1 year ago

The functions have been successfully merged