Hi all (and especially @hiron if i’m not mistaken),
I’ve been trying to make Tunny work with rhino.compute
. I’ve been using the tunny_optimization_without_ui
from the examples and adapted it so, that it returns as a string the best generation:
I ran it with a local compute server instance. The behavior is quite weird: i’ve managed to see that
-
It doesn’t work the first time
-
But it works fine the second time when launched with the same input
I think the thing here is that the first time it works but the component doesn’t “stop” the Grasshopper flow so it returns an empty string while being processed.
When i relaunch the definition, the solution is already cached, so it works fine (with the same input, of course if i change the input it fails as well).
Here are the logs associated to the compute (being processed in between the first and second time):
CG [18:31:38 INF] Load existing setting.json
CG [18:31:39 INF] Trial 1 finished with values: {'v0': 1460, 'v1': 145} and parameters: {'x': 13, 'y': 14}.
Speckle - Backup headless doc is ready: 'Untitled'
with template: 'No template'
with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG [18:31:39 INF] Load existing setting.json
CG [18:31:39 INF] Trial 2 finished with values: {'v0': 980, 'v1': 505} and parameters: {'x': -7, 'y': -14}.
Speckle - Backup headless doc is ready: 'Untitled'
with template: 'No template'
with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG [18:31:39 INF] Load existing setting.json
CG [18:31:39 INF] Trial 3 finished with values: {'v0': 1124, 'v1': 221} and parameters: {'x': -5, 'y': 16}.
Speckle - Backup headless doc is ready: 'Untitled'
with template: 'No template'
with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG [18:31:39 INF] Load existing setting.json
CG [18:31:39 INF] Trial 4 finished with values: {'v0': 1280, 'v1': 130} and parameters: {'x': 16, 'y': 8}.
Speckle - Backup headless doc is ready: 'Untitled'
with template: 'No template'
with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG [18:31:39 INF] Load existing setting.json
CG [18:31:39 INF] Trial 5 finished with values: {'v0': 884, 'v1': 361} and parameters: {'x': -14, 'y': 5}.
Speckle - Backup headless doc is ready: 'Untitled'
with template: 'No template'
with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG [18:31:39 INF] Load existing setting.json
CG [18:31:39 INF] Trial 6 finished with values: {'v0': 2084, 'v1': 261} and parameters: {'x': 20, 'y': 11}.
Speckle - Backup headless doc is ready: 'Untitled'
with template: 'No template'
with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG [18:31:40 INF] Load existing setting.json
CG [18:31:40 INF] Trial 7 finished with values: {'v0': 1856, 'v1': 394} and parameters: {'x': 20, 'y': -8}.
Speckle - Backup headless doc is ready: 'Untitled'
with template: 'No template'
with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG [18:31:40 INF] Load existing setting.json
CG [18:31:40 INF] Trial 8 finished with values: {'v0': 260, 'v1': 225} and parameters: {'x': -7, 'y': -4}.
Speckle - Backup headless doc is ready: 'Untitled'
with template: 'No template'
with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG [18:31:40 INF] Load existing setting.json
CG [18:31:40 INF] Trial 9 finished with values: {'v0': 1636, 'v1': 229} and parameters: {'x': 3, 'y': 20}.
CG [18:31:46 INF] Solver completed successfully. The specified number of trials has been completed.
Speckle - Backup headless doc is ready: 'Untitled'
with template: 'No template'
with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG [18:31:46 INF] Load existing setting.json
Is there anything i can do to “stop the flow before Tunny has ended processing the solution” ?
Here’s the file so you can see better what i tried: tunny_optimization_without_ui.gh
Thanks in advance,
Best