Engine

class Engine

Main engine class. Connects to ampl process and so forth.

Author:Christian

Fields

currentSource

Source currentSource

Constructors

Engine

public Engine(Environment environment, AMPL parentAMPL)

Constructor

Parameters:
  • environment – Environment(working directory and others)
  • parentAMPL – Parent ampl (to get the error handler and others)
Throws:
  • LicenseException
  • IOException

Methods

getAmpl

public AMPL getAmpl()

getProcess

AMPLProcess getProcess()

getVersion

int getVersion()

innerDiagnose

void innerDiagnose(RuntimeException e)

interpret

AMPLOutputs interpret(Source s)

interpret

void interpret(Source s, OutputHandler output)

interpret

AMPLOutputs interpret(String s)

To be used for service calls to AMPL

Parameters:
  • s – Source
Returns:

Outputs

interpretAsync

void interpretAsync(Source s, Runnable callback, OutputHandler output)

interrupt

public void interrupt()

isBusy

public boolean isBusy()

isRunning

public boolean isRunning()

onBeginSolve

public void onBeginSolve()

setDontSkipZeroRows

void setDontSkipZeroRows(boolean restore)

start

public boolean start()

stop

public void stop()