Warning: Covid19.SCH_Example expects argument type(s) (int, double[][], double[], double[], System.FuncOfListOfListOfDoubleAndListOfDouble), but was called with (int, double[], int[], int[], Function).
My ZT node expects FuncOfListOfListOfDoubleAndListOfDouble but receives Function.
My zero touch node have this code:
public static List<List<double>> SCH_Example( int limit,
List<List<double>> initValues,
List<double> lowerLimits, List<double> upperLimits,
Func<List<List<double>>, List<double>> fitFunction)
{
return new List<List<double>>();
}
In other word, How to input a custom node as a parameter to my zero touch node? I want to make something like whileLoop found on Dynamo.
The SCHFitnessFunction-1 node has a missing input, and as such is in a function state (note the lighter grey color). Add the required input and you should get the info you need.
Looks like the object type returned by the SCH Fitness Function-1 node is a double, but your Covid19SCH_Example node is expecting something else.
Did you create the fitness function node as well? if so consider migrating that over to a zero touch node so that it returns the custom data type you’re using in your zero touch node (System.FuncOfListOfListOfDoubleAndListOfDouble to be precise).
Actually, this is something I was trying to avoid… I wanted the user to define his custom logic as a custom node and then input it as a parameter to my ZTN.
I could make this custom node as another method inside my code, but this will not serve me on the long term.
LoopWhile node receives Function Object as a parameter to loopBody and continueWhile inputs… I want to make something exactly like loopWhile
Ah! I am not aware of a way to consume a function with a ZT node… The object type would likely need to be a dynamo function rather than the custom object type which you’re using now.
There may be a few options other for the process you’re working though (pass your node as a Dynamo function into something which consumes the design data) but without seeing more of the overall scope it’s hard to say.
to do this, you’ll need to implement your node that same way map or loop while are implemented - with designscript:
the issue is that the DS functionObject needs to be marshaled to a c# delegate to be called in your ZT node - but thats not easy to do - what if the function is pointing to DS code, .net won’t know how to marshall that or execute it.