Annotations for Python API users

CPLEX supports annotations for Benders decomposition in the Python API.

These classes support annotations in the Python API of CPLEX:
  • AnnotationObjectType
  • AnnotationInterface
There are also methods for adding, accessing, and modifying annotations of a model.
  • Cplex.long_annotations.add adds a new annotation to a model.
  • Cplex.long_annotations.delete deletes the annotation from an element of a model.
  • Cplex.long_annotations.get_names returns the names of a set of annotations.
  • Cplex.long_annotations.get_num returns the number of annotations of a model.
  • Cplex.long_annotations.get_types returns the type of a set of annotations.
  • Cplex.long_annotations.get_default_values returns the default value of a set of annotations.
  • Cplex.long_annotations.set_values sets annotations for a specified object type.
  • Cplex.long_annotations.get_values returns the annotations for a specified object type.
  • Cplex.double_annotations.add adds a new annotation to a model.
  • Cplex.double_annotations.delete deletes the annotation from an element of a model.
  • Cplex.double_annotations.get_names returns the names of a set of annotations.
  • Cplex.double_annotations.get_num returns the number of annotations of a model.
  • Cplex.double_annotations.get_types returns the type of a set of annotations.
  • Cplex.double_annotations.get_default_values returns the default value of a set of annotations.
  • Cplex.double_annotations.set_values sets annotations for a specified object type.
  • Cplex.double_annotations.get_values returns the annotations for a specified object type.
  • Cplex.read_annotations reads annotations from a file.
  • Cplex.write_annotations writes annotations to a file.
  • Cplex.write_benders_annotation writes to a file any annotations that CPLEX automatically generated.

For detailed documentation and examples of methods in these classes, see the entries for these classes in the reference manual of the Python API of CPLEX, and see also doc strings in <Install_dir>/cplex/python/3.7/<your_platform>/cplex/_internal/_anno.py or <Install_dir>/cplex/python/3.8/<your_platform>/cplex/_internal/_anno.py, where <your_platform> is a platform-specific directory, such as x64_win64.