Comments (3)
I think this would be more in-line with how the Unreal Engine Blueprint system functions, where each execution node would propagate synchronously, performing its respective action and then returning to execute the next node.
Actually, Unreal blueprints are compiled from the node graph to a class before they are used in game. (source) It does a better job of hiding it by providing visual feedback on what the nodes do in a debugger during execution, but under the hood it is compiled before usage. Some advantages to this strategy are easier debugging, performance optimization by a pre-existing compiler, less runtime overhead, greater portability of the resulting code, ...
That being said, if you don't like using strings you could consider using expression trees instead. These can be both serialized and transformed into a runnable function at runtime.
If you want to skip the intermediary step entirely and go straight to running code from nodes that is possible too. Instead of producing functions as strings, you would put the code straight into the node (or store a Func/Action). Each node of your node viewmodels could implement a common interface which provides a Run() method. Invoking this method on node A calls the Run() method on each of the nodes connected to its inputs to obtain the input values. It then calculates the result of node A and returns it. If you call Run() on the last node in the chain, the entire tree is recursively evaluated. Note that the inputs/outputs don't hold values, but only serve to connect functions.
If you decide that you want the functions to be run immediately as they are connected, then you would probably end up with something similar to the calculator example.
Does this answer your questions?
from nodenetwork.
Thank you it does answer my question. I am assuming the Compile() methods are what gets called recursively? And in those methods there should be the entry point to executing additional code?
from nodenetwork.
That is correct.
from nodenetwork.
Related Issues (20)
- Problem with Custom Input Editor
- Constructor behaviour HOT 2
- ListNode doesn't receive updates when create in code. HOT 2
- Facing an odd Issue in the hello world example. HOT 2
- NNViewRegistrar Pending registrations seems unusable HOT 1
- Values are not "flowing through" connections HOT 10
- How to use NodeNetwork with the WinForm project? HOT 1
- Is it possible to check the mouse click event? HOT 3
- More easy code editor in 'one line' ?
- Avalonia Port HOT 1
- Is there any way to create an auto-expanding array of ports? HOT 2
- AddEndpointDropPanel shows also if the connection is not compatible
- Documentation and project creation
- network.Nodes.Add(node1); and node1.Inputs.Add(node1Input); not working HOT 1
- How to access all the nodes
- Memory leak when adding and removing nodes HOT 2
- Is there any way to keep the nodes connected and not disconnect when dragging? HOT 2
- Displaying bound fields on nodes
- Missing example for group nodes
- When the group output nodes are in a closed state, adding outputs can cause drawing errors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodenetwork.