OutputHandler¶
-
class
amplpy.
OutputHandler
¶ Implement this interface to handle the outputs from the calls to any function that causes the underlying AMPL interpreter to display a message.
Note that errors and warnings are not passed through this interface, see
ErrorHandler
for 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'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
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 thecd
function.
-
DISPLAY
= 3¶ Output
display
, returned by thedisplay
function.
-
EXIT
= 4¶ Output
exit
, returned as last message from AMPL before exiting the interpreter.
-
EXPAND
= 5¶ Output
expand
, returned by theexpand
function.
-
LOAD
= 6¶ Output
load
, returned by theload
function when loading a library.
-
OPTION
= 7¶ Output
option
, returned by theoption
function when getting the value of an option.
-
PRINT
= 8¶ Output
print
, returned by theprint
function 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 thesolve
function, contains the solver message.
-
SHOW
= 12¶ Output
show
, returned by theshow
function.
-
XREF
= 13¶ Output
xref
, returned by thexref
function.
-
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
check
operation.
-
CLOSE
= 24¶ Output of a
close
command for output redirection.
-
COMMANDS
= 25¶ Output of a
commands
call into another file.
-
CONTINUE
= 26¶ Issued when
continue
is encountered.
-
DATA
= 27¶ Output of a
data
command.
-
DELETECMD
= 28¶ Output of a
delete
command.
-
DROP
= 29¶ Output of a
drop
command.
-
DROP_OR_RESTORE_ALL
= 30¶ Internal.
-
__dict__
= dict_proxy({'RESET': 51, 'THEN': 56, '__module__': 'amplpy.outputhandler', 'OPTION': 7, 'CHECK': 23, '_READTABLE': 19, 'READ': 46, 'PRINTF': 42, 'SOLUTION': 10, 'PURGE': 44, '__dict__': <attribute '__dict__' of 'Kind' objects>, '_WRITETABLE': 20, 'ELSE_CHECK': 32, 'WRITE_TABLE': 17, 'PRINT': 8, 'EXIT': 4, 'DATA': 27, 'DISPLAY': 3, 'EXPAND': 5, 'RBRACE': 45, 'SEMICOLON': 54, '__weakref__': <attribute '__weakref__' of 'Kind' objects>, 'DROP': 29, 'CALL': 22, 'LOOPEND': 39, 'SHELL_OUTPUT': 14, 'READ_TABLE': 18, 'CLOSE': 24, 'ENDIF': 33, '__doc__': '\n Represents the type of the output coming from the interpreter.\n ', 'SHELL_MESSAGE': 15, 'LOAD': 6, 'REPEAT': 49, 'PROMPT': 9, 'RUN_ARGS': 53, 'FOR': 36, 'SHOW': 12, 'FIX': 35, 'MISC': 16, 'UPDATE': 59, 'CD': 2, 'WRITE': 60, 'DELETECMD': 28, 'SOLVE': 11, 'BREAKPOINT': 21, 'OBJECTIVE': 40, 'DROP_OR_RESTORE_ALL': 30, 'PROBLEM': 43, 'ELSE': 31, 'IF': 37, 'RESTORE': 52, 'COMMANDS': 25, 'XREF': 13, 'SSTEP': 55, 'UNLOAD': 58, 'WAITING': 0, 'REMOVE': 48, 'REPEAT_END': 50, 'BREAK': 1, 'RELOAD': 47, 'CONTINUE': 26, 'LET': 38, 'ENVIRON': 34, 'UNFIX': 57, 'OPTION_RESET': 41})¶
-
__module__
= 'amplpy.outputhandler'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
ELSE
= 31¶ Else block.
-
ELSE_CHECK
= 32¶ Internal.
-
ENDIF
= 33¶ End of if block.
-
ENVIRON
= 34¶ Output of a
environ
command.
-
FIX
= 35¶ Output of a
fix
command.
-
FOR
= 36¶ Output of a
for
command.
-
IF
= 37¶ Output of an
if
command.
-
LET
= 38¶ Output of a
let
command.
-
LOOPEND
= 39¶ End of loop.
-
OBJECTIVE
= 40¶ Output of an
objective
command.
-
OPTION_RESET
= 41¶ Occurs when resetting option values.
-
PRINTF
= 42¶ Output of a
printf
command.
-
PROBLEM
= 43¶ Output of a
problem
command.
-
PURGE
= 44¶ Output of a
purge
command.
-
RBRACE
= 45¶ Occurs when a right brace is encountered.
-
READ
= 46¶ Output of a
read
command.
-
RELOAD
= 47¶ Output of a
reload
command.
-
REMOVE
= 48¶ Output of a
remove
command.
-
REPEAT
= 49¶ Beginning of a repeat loop.
-
REPEAT_END
= 50¶ End of a repeat loop.
-
RESET
= 51¶ Output of a
reset
command.
-
RESTORE
= 52¶ Output of a
restore
command.
-
RUN_ARGS
= 53¶ Internal.
-
SEMICOLON
= 54¶ Internal.
-
SSTEP
= 55¶ Internal.
-
THEN
= 56¶ Beginning of the
then
part of an if statement.
-
UNFIX
= 57¶ Output of an
unfix
command.
-
UNLOAD
= 58¶ Output of an
unload
command.
-
UPDATE
= 59¶ Output of an
update
command.
-
WRITE
= 60¶ Output of a
write
command.
-