Skip to content

Python model debugging #1195

Answered by mondus
society-research asked this question in Q&A
Discussion options

You must be logged in to vote

Just to follow up.

Is it possible to access printf from agent-python?

Actually yes. #884 Gives an example of how to call printf from Python. You will need to use printf rather than print and treat the arguments as they would be used in C/C++. E.g. provide a string fomratted and the subsequent arguments. This will produce a compilation warning. E.g. "Function call is not a defined FLAME GPU device function or a supported python built in.".

Perhaps a better way is to store the value you want to debug in an agent variable and then either in a step or exit function obtain the agent population so you can examine each of the agent variables.

Not sure why your debugging process is not working …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mondus
Comment options

Answer selected by society-research
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants