You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have played with the APSIM code generated by Crop2ML to make it simpler for set up in APSIM.
I am wondering if model unit code could be generated like below. If so, then we don't need components or wrappers.
Have [Link] statements for State, State1, Rate, Auxillary, Exogenous classes etc rather than passing them into Init and CalculateModel. If they aren't being used then don't declare them in the class.
Add [EventSubscribe("Crop2MLInit")] before Init method
Add [EventSubscribe("Crop2MLCalculateModel")] before CalculateModel method
Remove all constructors (including copy constructor) as they aren't needed by APSIM.
For exogenous variables, link to [Link] Crop2MLExogenous ex = null; rather than SurfaceTemperaturePartonExogenous. We will create Crop2MLExogenous so there is no need to have Crop2ML generate this.
For parameters, use the same link as for exogenous rather than have them as class properties.
I have played with the APSIM code generated by Crop2ML to make it simpler for set up in APSIM.
I am wondering if model unit code could be generated like below. If so, then we don't need components or wrappers.
[Link]
statements for State, State1, Rate, Auxillary, Exogenous classes etc rather than passing them into Init and CalculateModel. If they aren't being used then don't declare them in the class.[Link] Crop2MLExogenous ex = null;
rather than SurfaceTemperaturePartonExogenous. We will createCrop2MLExogenous
so there is no need to have Crop2ML generate this.If this is possible then I might be able to create a PR to do this. I can see the APSIM generator code here: https://github.com/AgriculturalModelExchangeInitiative/PyCrop2ML/blob/master/src/pycropml/transpiler/generators/apsimGenerator.py.
The text was updated successfully, but these errors were encountered: