MODE

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

MODE

Previous pageReturn to chapter overviewNext page

The MODE statement switches between sim mode (model simulation), data mode (data revision programs etc.), and mixed mode (mixing sim- and data mode). Mixed mode is default. The modes are reflected on the status bar at the bottom of the main window (cf. the colors in the table below: green, blue or yellow).

 

Sim mode: Focused on MODEL, READ, SERIES, SIM, PRT/MULPRT, WRITE and similar statements. The Ref (reference) databank is essential in sim mode (to show simulation differences/multipliers). See here regarding an overview of statements that have primarily sim flavour.

Data mode: Focused on OPEN, COPY, IMPORT, SERIES, PRT, CLOSE and similar statements. The reference bank is often not used at all in this mode. See here regarding an overview of statements that have primarily data flavour.

Mixed mode: models and data handling can be mixed as the user wishes. Please note that this mode is more flexible, but also has more room for errors, if care is not taken (for instance whether a variable is a model variable, or whether a variable is from the first-position databank or stems from some other open databank).

 

It should be emphasized, however, that most statements and functionality can be used in all modes, but there are some nuances. Below, an overview of the settings associated with the three different modes.

 

 

Mode

Sim

Data

Mixed

option databank search = ...

In sim-mode, the user should use READ ... TO ... (which is equivalent to OPEN) to open extra 'named' databanks, and in this case, explicit databank colon must be used afterwards to refer to the timeseries. In data- and mixed mode, Gekko will search for a timeseries x (without databank colon) in all databanks except Ref in the F2 window.

no

yes

yes

option databank create auto = ...

In sim-mode, the user has to first CREATE a new timeseries, before putting data into it with the SERIES statement. This is to avoid that the user accidentally issues a "SERIES x = ... ;" statement, thinking that he or she changes a model variable, when in fact x is not part of the model. (If the timeseries name starts with 'xx', CREATE is not mandatory in sim mode). In data- and mixed modes, a SERIES statement will auto-create the timeseries, if it does not exist beforehand.

 

no

yes

yes

option solve data create auto = ...

In sim-mode, when the user issues a general READ statement, any model variables (contained in the list #all) not present in the data file will be auto-created (including missing variables of D-, J-, and Z-types). In data-mode, such creation is not performed, even if a model is present.

 

yes

no

yes

In addition to this, 'OPTION interface mode' is set to sim/data/mixed. This option directs the following behavior:

 

In sim-mode, READ ... TO ... is recommended instead of OPEN. OPEN<edit>, OPEN<first> or OPEN<ref> are warned against.

In sim- and mixed-mode, general READ will tell the user about superfluous variables not in the model.

In data-mode, general READ is warned against

In data-mode, MODEL, SIM, CLONE and MULPRT are warned against.

 

 

Gekko starts out in mixed mode per default. You may set the mode in the gekko.ini file (see INI). If you need Gekko to always start out in a particular mode, you can use a gekko.ini containing for instance the statement mode sim; in the same folder as the gekko.exe file.

 

 


 

Syntax

 

mode mode;
mode ?;

 

mode

Choose between sim, data or mixed. Default is sim mode.

?

Shows the current mode.

 

 


 

Example

 

This statement changes to sim mode:

 

mode sim;

 

 


 

Note

 

The MODE functionality will be continuously developed, but the intention is to avoid making modes more complicated than they really are. Modes try to help the user focus on the tasks at hand, rather than being confused about non-relevant Gekko capabilities.

 

See also the databank search page.

 

Note that the Local or Global databanks are always searchable, independent on MODE etc.

 

 


 

Related options

 

OPTION databank search = ...

OPTION databank create auto = ...

OPTION solve data create auto = ...

OPTION interface mode = [sim | data | mixed];

 

 

 


 

Related statements

 

RESET, RESTART, INI