OutputHandler¶
- class amplpy.OutputHandler¶
Interface to handle the outputs from the calls to any function that causes the underlying AMPL interpreter to display a message. If an application needs to implement customised output handling, it must implement this interface and then register an instance with the AMPL API using the
set_output_handler()method.Note that errors and warnings are not passed through this interface, see
ErrorHandlerfor more information.- output(kind, msg)¶
This method is called when AMPL sends some output derived from executing a statement.
- Args:
kind: kind of the output of the AMPL interpreter.
msg: text of the output by the AMPL interpreter.
- __module__ = 'amplpy.outputhandler'¶
- class amplpy.Kind¶
Represents the type of the output coming from the interpreter.
- WAITING = 0¶
Output
prompt2, returned when incomplete statements are interpreted.
- BREAK = 1¶
Output
break, displayed when an operation is interrupted with SIGINT.
- CD = 2¶
Output
cd, returned by thecdfunction.
- DISPLAY = 3¶
Output
display, returned by thedisplayfunction.
- EXIT = 4¶
Output
exit, returned as last message from AMPL before exiting the interpreter.
- EXPAND = 5¶
Output
expand, returned by theexpandfunction.
- LOAD = 6¶
Output
load, returned by theloadfunction when loading a library.
- OPTION = 7¶
Output
option, returned by theoptionfunction when getting the value of an option.
- PRINT = 8¶
Output
print, returned by theprintfunction when printing values from AMPL command line.
- PROMPT = 9¶
Output
prompt1, normal AMPL prompt.
- SOLUTION = 10¶
Output
solution, returned when loading a solution with the commandsolution, contains the solver message.
- SOLVE = 11¶
Output
solve, returned by thesolvefunction, contains the solver message.
- SHOW = 12¶
Output
show, returned by theshowfunction.
- XREF = 13¶
Output
xref, returned by thexreffunction.
- SHELL_OUTPUT = 14¶
Output of the AMPL command
shell.
- SHELL_MESSAGE = 15¶
Messages from the command
shell.
- MISC = 16¶
Output
misc.
- WRITE_TABLE = 17¶
Messages from the command
write table.
- READ_TABLE = 18¶
Messages from the command
read table.
- BREAKPOINT = 21¶
Breakpoint hit.
- CALL = 22¶
Output of a script
call.
- CHECK = 23¶
Output of a
checkoperation.
- CLOSE = 24¶
Output of a
closecommand for output redirection.
- COMMANDS = 25¶
Output of a
commandscall into another file.
- CONTINUE = 26¶
Issued when
continueis encountered.
- DATA = 27¶
Output of a
datacommand.
- DELETECMD = 28¶
Output of a
deletecommand.
- DROP = 29¶
Output of a
dropcommand.
- DROP_OR_RESTORE_ALL = 30¶
Internal.
- __module__ = 'amplpy.outputhandler'¶
- ELSE = 31¶
Else block.
- ELSE_CHECK = 32¶
Internal.
- ENDIF = 33¶
End of if block.
- ENVIRON = 34¶
Output of a
environcommand.
- FIX = 35¶
Output of a
fixcommand.
- FOR = 36¶
Output of a
forcommand.
- IF = 37¶
Output of an
ifcommand.
- LET = 38¶
Output of a
letcommand.
- LOOPEND = 39¶
End of loop.
- OBJECTIVE = 40¶
Output of an
objectivecommand.
- OPTION_RESET = 41¶
Occurs when resetting option values.
- PRINTF = 42¶
Output of a
printfcommand.
- PROBLEM = 43¶
Output of a
problemcommand.
- PURGE = 44¶
Output of a
purgecommand.
- RBRACE = 45¶
Occurs when a right brace is encountered.
- READ = 46¶
Output of a
readcommand.
- RELOAD = 47¶
Output of a
reloadcommand.
- REMOVE = 48¶
Output of a
removecommand.
- REPEAT = 49¶
Beginning of a repeat loop.
- REPEAT_END = 50¶
End of a repeat loop.
- RESET = 51¶
Output of a
resetcommand.
- RESTORE = 52¶
Output of a
restorecommand.
- RUN_ARGS = 53¶
Internal.
- SEMICOLON = 54¶
Internal.
- SSTEP = 55¶
Internal.
- THEN = 56¶
Beginning of the
thenpart of an if statement.
- UNFIX = 57¶
Output of an
unfixcommand.
- UNLOAD = 58¶
Output of an
unloadcommand.
- UPDATE = 59¶
Output of an
updatecommand.
- WRITE = 60¶
Output of a
writecommand.