Closed bgdxqi closed 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?
What will be the output of these functions exactly? List, ArrayList, Map?
What will be the output of these functions exactly? List, ArrayList, Map?
As for now, an ArrayList<InputPort>
and ArrayList<OutputPort>
separately
@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.
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
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
But will the output change, if we decide to add names to ports in your function?
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.
The functions have been successfully merged
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.