<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AIMMS Blog</title>
	<atom:link href="http://blog.aimms.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.aimms.com</link>
	<description>How-to, tips &#38; tricks, and other useful information for AIMMS users</description>
	<lastBuildDate>Mon, 14 May 2012 11:53:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Using model tree structure information in your model</title>
		<link>http://blog.aimms.com/2012/05/using-model-tree-structure-information-in-your-model/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-model-tree-structure-information-in-your-model</link>
		<comments>http://blog.aimms.com/2012/05/using-model-tree-structure-information-in-your-model/#comments</comments>
		<pubDate>Mon, 14 May 2012 11:53:01 +0000</pubDate>
		<dc:creator>Guido Diepen</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[modeling]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=1243</guid>
		<description><![CDATA[The tree structure of the model explorer in AIMMS allows you as a modeller to structure your project and make it easy to maintain a good overview. Especially if your model becomes larger, having a well structured model will allow &#8230; <a class="more-link" href="http://blog.aimms.com/2012/05/using-model-tree-structure-information-in-your-model/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The tree structure of the model explorer in AIMMS allows you as a modeller to structure your project and make it easy to maintain a good overview. Especially if your model becomes larger, having a well structured model will allow you to quickly find the identifiers you need. For AIMMS, the structure and order of the tree are not important: if you want, you could even declare all your identifiers under one declaration section.</p>
<p>One of the nice things is that you can actually use the information from the tree structure in your model: each section or declaration section that you introduce in your model will automatically create a new set in AIMMS with the same name as the section. This new set is a subset of the predefined set AllIdentifiers and it will contain all identifiers that are declared under the section or declaration section.</p>
<p><div id="attachment_1244" class="wp-caption alignright" style="width: 320px"><img src="http://blog.aimms.com/wp-content/uploads/2012/05/model_tree.png" alt="Example of structured model tree" title="Example of structured model tree " width="310" height="319" class="size-full wp-image-1244" /><p class="wp-caption-text">Example of structured model tree </p></div>Suppose that you have a model tree with the structure depicted on the right. This means that AIMMS will automatically create the following subsets of AllIdentifiers:</p>
<ul>
<li>Input_Section</li>
<li>Set_declarations</li>
<li>Location_declarations</li>
<li>Transport_declarations</li>
<li>Output_Section</li>
</ul>
<p>As you can see from the above list, AIMMS will convert the spaces in the names of the (declaration) sections into underscores. This conversion is done because identifiers in AIMMS cannot contain spaces. </p>
<p>From the above list, you can also see that no separate set is created for the declaration section &#8220;Declaration&#8221; under the section Output Section. The reason for this is that no two identifiers in AIMMS can have the same name. The only exception to this rule is declaration sections that can all share the name Declaration. This means that for declaration sections, AIMMS will only automatically create the subset of AllIdentifiers if it has a different name than the default name Declaration.</p>
<p>The set Set_declarations from the example above will only contain the element <em>&#8216;Locations&#8217;</em>. The set Input_Section will not only contain all the identifiers declared under it explicitly, but it will also contain the sets that are automatically created because of the (declaration) sections under it. This means that it will also contain the elements <em>&#8216;Set_Declarations&#8217;</em>, <em>&#8216;Location_declarations&#8217;</em>, and <em>&#8216;Transport_declarations&#8217;</em>. </p>
<p>Note that any of the indices declared with sets are seen as separate elements in the set. For example, the set Locations has three indices: loc, locFrom, and locTo. These three indices will be three separate elements in both the sets Input_Section and Set_declarations.</p>
<p>A typical example use for these automatically created sets is that you are able to empty specific parts of your model. For example, if you want to empty all the identifiers in your model that are related to input, you can do so with the following statement:</p>

<div class="wp_syntax"><div class="code"><pre class="aim" style="font-family:monospace;">empty Input_Section ;</pre></div></div>

<p>Similarly, with the write statement you can also write the contents of all identifiers declared under the given section to a file as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="aim" style="font-family:monospace;"><span style="color: #0000FF;">write</span> Input_Section to file <span style="color: #808080; font-style: italic ">&quot;values_of_identifers_under_Input.txt&quot;</span> ;</pre></div></div>

<p>If you want to see the exact contents of such a automatically created set, you can assign its contents to a set you declared in your model. Please keep in mind that you will have to declare this set to be a subset of AllIdentifiers. If you have such a subset of AllIdentifiers, e.g. mySubSet, you can use the following statement:</p>

<div class="wp_syntax"><div class="code"><pre class="aim" style="font-family:monospace;">mySubSet <span style="color: #339933;">:=</span> Input_Section ;</pre></div></div>

<p>to assign the contents of the automatically created set to the set mySubset, after which you can inspect the data of mySubSet.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/05/using-model-tree-structure-information-in-your-model/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Displaying line numbers in the editor of the AIMMS IDE</title>
		<link>http://blog.aimms.com/2012/05/displaying-line-numbers-in-the-editor-of-the-aimms-ide/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=displaying-line-numbers-in-the-editor-of-the-aimms-ide</link>
		<comments>http://blog.aimms.com/2012/05/displaying-line-numbers-in-the-editor-of-the-aimms-ide/#comments</comments>
		<pubDate>Tue, 08 May 2012 15:18:27 +0000</pubDate>
		<dc:creator>Guido Diepen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=1209</guid>
		<description><![CDATA[When you want to share some information about your model, you typically want to direct another person to take a look at specific lines in a procedure or a definition. In order to do this, you will need to know &#8230; <a class="more-link" href="http://blog.aimms.com/2012/05/displaying-line-numbers-in-the-editor-of-the-aimms-ide/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When you want to share some information about your model, you typically want to direct another person to take a look at specific lines in a procedure or a definition. In order to do this, you will need to know the specific line number. By default, the editor in the IDE of AIMMS will not show any line numbers in attributes that can be multi-line. </p>
<p>You can enable the display of line numbers in the editor settings, which you can access via <em>Editor Settings&#8230;</em> under the Settings menu. If you go to the Misc tab, you will see the following options:<div id="attachment_1220" class="wp-caption alignnone" style="width: 423px"><img src="http://blog.aimms.com/wp-content/uploads/2012/05/IDE-editor-settings.png" alt="AIMMS IDE Editor settings" title="AIMMS IDE Editor settings" width="413" height="411" class="size-full wp-image-1220" /><p class="wp-caption-text">AIMMS IDE Editor settings</p></div></p>
<p>By changing the value for the setting LineNumberMargin to <strong>True</strong>, AIMMS will display the line numbers for all the attributes that can consist of multiple lines. The result will look like the image below:<div id="attachment_1223" class="wp-caption alignnone" style="width: 309px"><img src="http://blog.aimms.com/wp-content/uploads/2012/05/multiline-attribute-field-with-linenumbers.png" alt="Line numbers displayed in multiple line attribute" title="Line numbers displayed in multiple line attribute" width="299" height="149" class="size-full wp-image-1223" /><p class="wp-caption-text">Line numbers displayed in multiple line attribute</p></div></p>
<p><div id="attachment_1225" class="wp-caption alignright" style="width: 252px"><img src="http://blog.aimms.com/wp-content/uploads/2012/05/jump-to-line.png" alt="Jump to specific line number" title="Jump to specific line number" width="242" height="101" class="size-full wp-image-1225" /><p class="wp-caption-text">Jump to specific line number by pressing Ctrl+g</p></div>After you have received a line number that is interesting, you can jump to a specific line number quickly by pressing the keyboard shortcut Ctrl+g. This will open the dialog depicted on the right. </p>
<p>Alternatively, you can open the same dialog via <em>Goto Line&#8230;</em> under the Edit menu. </p>
<p>Note that this Goto line function works regardless of whether the line numbers are displayed or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/05/displaying-line-numbers-in-the-editor-of-the-aimms-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickly get text representation of one or more identifiers</title>
		<link>http://blog.aimms.com/2012/05/quickly-get-text-representation-of-one-or-more-identifiers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quickly-get-text-representation-of-one-or-more-identifiers</link>
		<comments>http://blog.aimms.com/2012/05/quickly-get-text-representation-of-one-or-more-identifiers/#comments</comments>
		<pubDate>Thu, 03 May 2012 09:33:42 +0000</pubDate>
		<dc:creator>Guido Diepen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=1198</guid>
		<description><![CDATA[When you need to share some identifiers with another person (e.g. on the AIMMS Google group or during contact with AIMMS Support), most of the times you can just copy the definition field of a parameter/variable/constraint. However, sometimes you must &#8230; <a class="more-link" href="http://blog.aimms.com/2012/05/quickly-get-text-representation-of-one-or-more-identifiers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When you need to share some identifiers with another person (e.g. on the <a href="https://groups.google.com/forum/#!forum/aimms" title="AIMMS Google Group" target="_blank">AIMMS Google group</a> or during contact with AIMMS Support), most of the times you can just copy the definition field of a parameter/variable/constraint. However, sometimes you must not only share the definition, but the values of all attributes, including the index domain/unit/etc.</p>
<p>Of course, you can manually copy all of these attributes to a separate text editor window, but this is a rather cumbersome approach. Another approach is to put the identifiers you want to have the text representation for in a separate section and use the information in the article <a href="http://blog.aimms.com/2011/11/exporting-a-section-and-importing-it-in-another-aimms-project/" title="Exporting a section and importing it in another AIMMS project">Exporting a section and importing it in another AIMMS project</a> to export this section to an .aim file. Unfortunately, this approach also requires quite some additional steps.</p>
<p><div id="attachment_1199" class="wp-caption alignleft" style="width: 310px"><img src="http://blog.aimms.com/wp-content/uploads/2012/05/text_representation-300x134.png" alt="View selected identifiers as text" title="View selected identifiers as text" width="300" height="134" class="size-medium wp-image-1199" /><p class="wp-caption-text">View selected identifiers as text</p></div> A much easier and faster approach is to make use of the Text Representation option under the View menu. To use this feature, just select an identifier in the model tree and under the View menu, select Text Representation > Selected Parts. Alternatively, you can also press the keyboard shortcut Ctrl+T after you have selected the identifier in your model. After you pressed this, AIMMS will open a new window/tab page containing the textual representation of the identifier selected. You can then copy these contents and share it with other people.</p>
<p>You can also select multiple identifiers in the model tree by pressing the Ctrl key while selecting the additional identifiers in the tree.</p>
<p>The resulting new tab page that is opened will look something like the image below:<br />
<div id="attachment_1216" class="wp-caption alignnone" style="width: 650px"><a href="http://blog.aimms.com/wp-content/uploads/2012/05/text_representation1.png"><img src="http://blog.aimms.com/wp-content/uploads/2012/05/text_representation1.png" alt="Text representation of selected identifiers" title="Text representation of selected identifiers" width="640" height="484" class="size-full wp-image-1216" /></a><p class="wp-caption-text">Text representation of selected identifiers</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/05/quickly-get-text-representation-of-one-or-more-identifiers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickly expanding all identifiers in the model tree</title>
		<link>http://blog.aimms.com/2012/04/quickly-expanding-all-identifiers-in-the-model-tree/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quickly-expanding-all-identifiers-in-the-model-tree</link>
		<comments>http://blog.aimms.com/2012/04/quickly-expanding-all-identifiers-in-the-model-tree/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 13:40:00 +0000</pubDate>
		<dc:creator>Guido Diepen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=1092</guid>
		<description><![CDATA[As most AIMMS users will know (or maybe should know ), the position where you double-click on an identifier (i.e. the icon or the text) in the model tree leads to different outcomes. If you double-click on the name of &#8230; <a class="more-link" href="http://blog.aimms.com/2012/04/quickly-expanding-all-identifiers-in-the-model-tree/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As most AIMMS users will know (or maybe should know <img src='http://blog.aimms.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ), the position where you double-click on an identifier (i.e. the icon or the text) in the model tree leads to different outcomes. If you double-click on the name of the identifier, you will always open the attribute form for the selected identifier.</p>
<p>If you double-click on the icon of the identifier that supports child identifiers (e.g. Section, Declaration Section, etc.), AIMMS will open the identifier node in the tree and show the child identifiers. In case of double-clicking on the icon of an identifier that does not support an underlying sub-tree, AIMMS will just open the attribute form (e.g. double-clicking on the [P] icon of a parameter identifier will just open the attribute form of the parameter). </p>
<p><div id="attachment_1186" class="wp-caption alignright" style="width: 256px"><img src="http://blog.aimms.com/wp-content/uploads/2012/04/FullyExpanded.png" alt="Quickly expand all sub-trees" title="Quickly expand all sub-trees" width="246" height="214" class="size-full wp-image-1186" /><p class="wp-caption-text">Quickly expand all sub-trees</p></div>When AIMMS opens the identifier node in the tree, it will just show the first layer of child identifiers. This means that at each level, you will have to expand an identifier node to get to the final declarations. </p>
<p>One of the lesser known features of AIMMS is that you can quickly expand all sub-trees that are below a selected identifier (e.g. a Section identifier). You can do this by pressing the CTRL key on your keyboard while double-clicking the icon of the identifier that can contain a sub-tree (e.g. Section). </p>
<p>An example of this is shown in the picture on the right. Note that you can do this at any point in your model tree. All the identifiers that are not in the sub-tree of the currently selected identifier will stay as they were, only the complete sub-tree under the currently selected identifier is expanded. Holding the CTRL key while using the right cursor key on the keyboard will have the same result (i.e. expand all sub-trees below the currently selected identifier).</p>
<p><div id="attachment_1187" class="wp-caption alignleft" style="width: 255px"><img src="http://blog.aimms.com/wp-content/uploads/2012/04/Sections-Expanded.png" alt="Quickly expand all sub-trees except declaration sections" title="Quickly expand all sub-trees except declaration sections" width="245" height="194" class="size-full wp-image-1187" /><p class="wp-caption-text">Quickly expand all sub-trees except declaration sections</p></div>A second option is that you do not want to expand all sub-trees, but only those sub-trees that are not under a declaration section. One of the reasons for this could be that you only want to see the structure of your AIMMS project, but not all the individual declarations for sets and parameters. </p>
<p>You can do this in AIMMS by not pressing the CTRL key while double-clicking on the identifier icon (or using the right cursor key), but pressing the Shift key. The picture on the left will show the result after pressing the Shift key while double-clicking on the book-icon in front of Section 1.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/04/quickly-expanding-all-identifiers-in-the-model-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Little trick to call AIMMS API from within AIMMS</title>
		<link>http://blog.aimms.com/2012/04/little-trick-to-call-aimms-api-from-within-aimms/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=little-trick-to-call-aimms-api-from-within-aimms</link>
		<comments>http://blog.aimms.com/2012/04/little-trick-to-call-aimms-api-from-within-aimms/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 15:37:33 +0000</pubDate>
		<dc:creator>Guido Diepen</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=1044</guid>
		<description><![CDATA[For an internal project I was working on, I had to determine whether a given procedure (provided by an element parameter in the predefined set AllProcedures) had a certain prototype (i.e. number/types of the arguments). In this particular case, I &#8230; <a class="more-link" href="http://blog.aimms.com/2012/04/little-trick-to-call-aimms-api-from-within-aimms/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For an internal project I was working on, I had to determine whether a given procedure (provided by an element parameter in the predefined set AllProcedures) had a certain prototype (i.e. number/types of the arguments). In this particular case, I wanted to check whether the given procedure had exactly one argument, which was a string parameter with the Input property.</p>
<p><div id="attachment_1157" class="wp-caption alignright" style="width: 240px"><img src="http://blog.aimms.com/wp-content/uploads/2012/04/recursion.jpg" alt="Recursion: See Recursion" title="Recursion: See Recursion" width="230" height="191" class="size-full wp-image-1157" /><p class="wp-caption-text">Recursion: See Recursion</p></div>Unfortunately, within the AIMMS language there is no direct way of obtaining the number of arguments of a procedure or the type. Luckily, the AIMMS API does provide this functionality. One of the features of AIMMS is that you can call methods in a DLL by introducing external procedure identifiers in your AIMMS project. By introducing an external procedure that uses the libaimms.dll, you can actually call the AIMMS API functions directly from within your project again. So from within AIMMS, you call the AIMMS API again.</p>
<p>I think that for most of the API functions provided by the libaimms.dll it is not very useful if you call them from within AIMMS again via this way. However, one of the methods in the DLL is AimmsProcedureHandleCreate, which creates a handle to an AIMMS procedure in the project. When you call this method, you will also get some information about the number of arguments and the type of each of these arguments.</p>
<p>To be able to call the AimmsProcedureHandleCreate (and the corresponding AimmsProcedureHandleDelete to delete the handle again afterwards) method from the libaimms.dll, you have to introduce the following two external procedure in your AIMMS project:</p>

<div class="wp_syntax"><div class="code"><pre class="aim" style="font-family:monospace;">EXTERNAL <span style="color: #000000; font-weight: bold;">PROCEDURE</span>
  <span style="color: #404040;">identifier</span>  :  AimmsProcedureHandleCreate
  arguments   :  <span style="color: #009900;">&#40;</span>theProcedure<span style="color: #339933;">,</span>theHandle<span style="color: #339933;">,</span>nArgs<span style="color: #339933;">,</span>argType<span style="color: #009900;">&#41;</span>
  dll name    :  <span style="color: #808080; font-style: italic ">&quot;libaimms.dll&quot;</span>
  <span style="color: #0000FF;">return</span> type :  integer
  <span style="color: #404040;">body</span> call   :  AimmsProcedureHandleCreate<span style="color: #009900;">&#40;</span>
                     scalar string : theProcedure<span style="color: #339933;">,</span>
                     scalar integer : theHandle<span style="color: #339933;">,</span>
                     scalar integer : nArgs<span style="color: #339933;">,</span>
                     array integer : argType
                   <span style="color: #009900;">&#41;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">DECLARATION SECTION</span> 
&nbsp;
    <span style="color: #000000; font-weight: bold;">ELEMENT PARAMETER</span>:
       <span style="color: #404040;">identifier</span>   :  theProcedure
       range        :  AllProcedures
       property     :  Input ;
&nbsp;
    <span style="color: #000000; font-weight: bold;">PARAMETER</span>:
       <span style="color: #404040;">identifier</span>   :  theHandle
       property     :  Output ;
&nbsp;
    <span style="color: #000000; font-weight: bold;">PARAMETER</span>:
       <span style="color: #404040;">identifier</span>   :  nArgs
       property     :  Output ;
&nbsp;
    <span style="color: #000000; font-weight: bold;">PARAMETER</span>:
       <span style="color: #404040;">identifier</span>   :  argType
       <span style="color: #404040;">index domain</span> :  iArgType
       property     :  Output ;
&nbsp;
    <span style="color: #000000; font-weight: bold;">SET</span>:
       <span style="color: #404040;">identifier</span>   :  sArgTypes
       <span style="color: #404040;">index</span>        :  iArgType ;
&nbsp;
  <span style="color: #000000; font-weight: bold;">ENDSECTION</span>  ;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">ENDPROCEDURE</span>  ;
&nbsp;
&nbsp;
&nbsp;
EXTERNAL <span style="color: #000000; font-weight: bold;">PROCEDURE</span>
  <span style="color: #404040;">identifier</span>  :  AimmsProcedureHandleDelete
  arguments   :  <span style="color: #009900;">&#40;</span>theHandle<span style="color: #009900;">&#41;</span>
  dll name    :  <span style="color: #808080; font-style: italic ">&quot;libaimms.dll&quot;</span>
  <span style="color: #0000FF;">return</span> type :  integer
  <span style="color: #404040;">body</span> call   :  AimmsProcedureHandleDelete<span style="color: #009900;">&#40;</span>
                     scalar integer : theHandle
                   <span style="color: #009900;">&#41;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">DECLARATION SECTION</span> 
&nbsp;
    <span style="color: #000000; font-weight: bold;">PARAMETER</span>:
       <span style="color: #404040;">identifier</span> :  theHandle
       property   :  Input ;
&nbsp;
  <span style="color: #000000; font-weight: bold;">ENDSECTION</span>  ;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">ENDPROCEDURE</span>  ;</pre></div></div>

<p>As you can see, the DLL that is used is the libaimms.dll. These two external procedures can then be used by one final procedure CheckProcedurePrototype that will check whether the procedure it gets as an argument has a certain prototype. The source of this procedure is the following:</p>

<div class="wp_syntax"><div class="code"><pre class="aim" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">PROCEDURE</span>
  <span style="color: #404040;">identifier</span> :  CheckProcedurePrototype
  arguments  :  <span style="color: #009900;">&#40;</span>theProcedure<span style="color: #009900;">&#41;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">DECLARATION SECTION</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">PARAMETER</span>:
       <span style="color: #404040;">identifier</span>   :  pProcHandle ;
&nbsp;
    <span style="color: #000000; font-weight: bold;">PARAMETER</span>:
       <span style="color: #404040;">identifier</span>   :  pNumArgs ;
&nbsp;
    <span style="color: #000000; font-weight: bold;">SET</span>:
       <span style="color: #404040;">identifier</span>   :  sProcArgs
       <span style="color: #404040;">index</span>        :  iProcArgs
       initial data :  <span style="color: #008000; font-style: italic;">!The maximum number of arguments we want to support</span>
                       <span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">..</span><span style="color: #cc66cc;">512</span><span style="color: #009900;">&#125;</span> ;
&nbsp;
    <span style="color: #000000; font-weight: bold;">PARAMETER</span>:
       <span style="color: #404040;">identifier</span>   :  pProcArgType
       <span style="color: #404040;">index domain</span> :  <span style="color: #009900;">&#40;</span>iProcArgs<span style="color: #009900;">&#41;</span> ;
&nbsp;
    <span style="color: #000000; font-weight: bold;">PARAMETER</span>:        
       <span style="color: #404040;">identifier</span>   :  pResult ;
&nbsp;
    <span style="color: #000000; font-weight: bold;">ELEMENT PARAMETER</span>:
       <span style="color: #404040;">identifier</span>   :  theProcedure
       range        :  AllProcedures
       property     :  Input ;
&nbsp;
  <span style="color: #000000; font-weight: bold;">ENDSECTION</span>  ; 
&nbsp;
  <span style="color: #404040;">body</span>       :  
    <span style="color: #008000; font-style: italic;">!Create handle to the procedure. When calling the</span>
    <span style="color: #008000; font-style: italic;">!API, we automatically get all the information about the</span>
    <span style="color: #008000; font-style: italic;">!arguments of this procedure</span>
    pResult <span style="color: #339933;">:=</span> AimmsProcedureHandleCreate<span style="color: #009900;">&#40;</span>
                    theProcedure :  theProcedure<span style="color: #339933;">,</span>
                    theHandle    :  pProcHandle<span style="color: #339933;">,</span>
                    nArgs        :  pNumArgs<span style="color: #339933;">,</span>
                    argType      :  pProcArgType <span style="color: #009900;">&#41;</span> ;
&nbsp;
    <span style="color: #0000FF;">if</span> pResult <span style="color: #0000FF;">then</span> 
            <span style="color: #008000; font-style: italic;">!If the API call was successful, we must delete the handle</span>
            AimmsProcedureHandleDelete<span style="color: #009900;">&#40;</span>theHandle : pProcHandle <span style="color: #009900;">&#41;</span> ;
&nbsp;
            <span style="color: #008000; font-style: italic;">!Now we can check the actual prototype. The meaning of the values</span>
            <span style="color: #008000; font-style: italic;">!in the pProcArgType parameter, can be found in the libaimms.h</span>
            <span style="color: #008000; font-style: italic;">!file in your AIMMS installation. The relevant parts are:</span>
&nbsp;
            <span style="color: #008000; font-style: italic;">!       #define AIMMSAPI_STORAGE_HANDLE  0x00000000</span>
            <span style="color: #008000; font-style: italic;">!       #define AIMMSAPI_STORAGE_DOUBLE  0x00000001</span>
            <span style="color: #008000; font-style: italic;">!       #define AIMMSAPI_STORAGE_INT     0x00000002</span>
            <span style="color: #008000; font-style: italic;">!       #define AIMMSAPI_STORAGE_BINARY  0x00000003</span>
            <span style="color: #008000; font-style: italic;">!       #define AIMMSAPI_STORAGE_STRING  0x00000004</span>
            <span style="color: #008000; font-style: italic;">!</span>
            <span style="color: #008000; font-style: italic;">!       #define AIMMSAPI_INPUT           0x00000010</span>
            <span style="color: #008000; font-style: italic;">!       #define AIMMSAPI_OUTPUT          0x00000020</span>
            <span style="color: #008000; font-style: italic;">!       #define AIMMSAPI_INPUT_OUTPUT    0x00000040</span>
&nbsp;
&nbsp;
            <span style="color: #008000; font-style: italic;">!For example, we want 1argument and it must be a string parameter</span>
            <span style="color: #008000; font-style: italic;">!that is input only. This means that we have to OR the value</span>
            <span style="color: #008000; font-style: italic;">!0x04 (STORAGE_STRING) and 0x10 (INPUT) to get the value 0x14</span>
            <span style="color: #008000; font-style: italic;">!0x14 (hex) =&gt; 20 (decimal)</span>
            <span style="color: #0000FF;">if</span> pNumArgs <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span> and pProcArgType<span style="color: #009900;">&#40;</span> <span style="color: #990000; font-weight: bold;">first</span><span style="color: #009900;">&#40;</span>iProcArgs<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span> <span style="color: #0000FF;">then</span>
                    <span style="color: #0000FF;">return</span> <span style="color: #cc66cc;">1</span> ;
            <span style="color: #0000FF;">endif</span> ;
    <span style="color: #0000FF;">endif</span> ;
&nbsp;
    <span style="color: #008000; font-style: italic;">!If the API call was not successful, or the prototype of the</span>
    <span style="color: #008000; font-style: italic;">!procedure was not correct, return the value 0</span>
    <span style="color: #0000FF;">return</span> <span style="color: #cc66cc;">0</span> ;
&nbsp;
<span style="color: #000000; font-weight: bold;">ENDPROCEDURE</span>  ;</pre></div></div>

<p>For more details about the AIMMS API and the above used methods, please take a look at the AIMMS documentation. </p>
<p><strong>Dicslaimer:</strong> Though the above code works (and I had a smile on my face when I found this possibility <img src='http://blog.aimms.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ), I would like to point out that you have to be extremely careful when calling the AIMMS API from within AIMMS this way: very quickly, you can end up in unpredictable situations because of the locking mechanisms used.</p>
<p>You can download the source of the above (external) procedures from the link below:<br />
<div class="attachments"><dl class="attachments attachments-large"><dt class="icon"><a title="Source file for CheckProcedurePrototype" href="http://blog.aimms.com/2012/04/little-trick-to-call-aimms-api-from-within-aimms/?aid=1160&amp;sa=1"><img src="http://blog.aimms.com/wp-includes/images/crystal/aim.png" width="48" height="48" alt="Source file for CheckProcedurePrototype" /></a></dt><dd class="caption"><strong>Title</strong> : <a title="Source file for CheckProcedurePrototype" href="http://blog.aimms.com/2012/04/little-trick-to-call-aimms-api-from-within-aimms/?aid=1160&amp;sa=1">Source file for CheckProcedurePrototype</a><br /><strong>Caption</strong> : Source file for CheckProcedurePrototype<br /><strong>File name</strong> : CheckProcedurePrototype.aim<br /><strong>Size</strong> : 4 kB</dd></dl></div></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/04/little-trick-to-call-aimms-api-from-within-aimms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using LoopCount instead of explicit counting parameter in loops</title>
		<link>http://blog.aimms.com/2012/04/using-loopcount-instead-of-explicit-counting-parameter-in-loops/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-loopcount-instead-of-explicit-counting-parameter-in-loops</link>
		<comments>http://blog.aimms.com/2012/04/using-loopcount-instead-of-explicit-counting-parameter-in-loops/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 12:18:14 +0000</pubDate>
		<dc:creator>Guido Diepen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[LoopCount]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=1126</guid>
		<description><![CDATA[There are cases where you want to execute some set of statements in an AIMMS procedure a couple of times. If you want to execute the statements times, the trivial (but not very smart) way would be to just copy &#8230; <a class="more-link" href="http://blog.aimms.com/2012/04/using-loopcount-instead-of-explicit-counting-parameter-in-loops/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are cases where you want to execute some set of statements in an AIMMS procedure a couple of times. If you want to execute the statements <img src='http://s0.wp.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n' title='n' class='latex' /> times, the trivial (but not very smart) way would be to just copy the statements <img src='http://s0.wp.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n' title='n' class='latex' /> times.</p>
<p>A better approach, which I guess is used most often, is to use a repetitive loop (for, while, repeat) and declare a new local parameter for this procedure that will be used to keep track of how many iterations have been done in the loop. To execute a block of statements <img src='http://s0.wp.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n' title='n' class='latex' /> times, you will first have to initialize this counter parameter to 0 or 1 (depending on your preference to start counting at 0 or 1) and then use a while-loop with a termination criteria to execute the statements repetitively. Furthermore, you must also ensure that you increment the value of your local counter parameter with one in each iteration. So if you declare the additional parameter myLoopCounter, the required code will look like:</p>

<div class="wp_syntax"><div class="code"><pre class="aim" style="font-family:monospace;"><span style="color: #008000; font-style: italic;">!Initialize the myLoopcounter to the value 1</span>
myLoopCounter <span style="color: #339933;">:=</span> <span style="color: #cc66cc;">1</span> ; 
<span style="color: #0000FF;">while</span> myLoopcounter <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">3</span> <span style="color: #0000FF;">do</span>
    <span style="color: #990000; font-weight: bold;">DialogMessage</span><span style="color: #009900;">&#40;</span><span style="color: #808080; font-style: italic ">&quot;Current iteration &quot;</span> <span style="color: #339933;">+</span> myLoopCounter <span style="color: #009900;">&#41;</span> ; 
    <span style="color: #008000; font-style: italic;">!And increment the counter by one</span>
    myLoopCounter <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">1</span> ; 
<span style="color: #0000FF;">endwhile</span> ;</pre></div></div>

<p>An even easier approach (but probably far less known) that does not require you to declare any temporary local parameters, is to make use of the predefined <em>LoopCount</em> operator in AIMMS. With repetitive loops  like <em>while</em>, <em>for</em>, and <em>repeat</em>, this LoopCount operator will automatically be incremented each time the loop is run. Using the LoopCount operator, the above code could be transformed into the following:</p>

<div class="wp_syntax"><div class="code"><pre class="aim" style="font-family:monospace;"><span style="color: #0000FF;">while</span> LoopCount <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">3</span> <span style="color: #0000FF;">do</span>
	<span style="color: #990000; font-weight: bold;">dialogMessage</span><span style="color: #009900;">&#40;</span><span style="color: #808080; font-style: italic ">&quot;Current iteration &quot;</span> <span style="color: #339933;">+</span> LoopCount<span style="color: #009900;">&#41;</span> ; 
<span style="color: #0000FF;">endwhile</span> ;</pre></div></div>

<p>If you have multiple nested loops, you can name each of these loops by using a loop string in the statement. You can access the value of a LoopCount corresponding to one particular of the nested loops by providing the loop string name as an argument to the LoopCount. If you do not provide any loop string, the LoopCount operator returns the value of the closest repetitive loop. If you run the example code below, you will see that when not providing a loop string, the value returned by the LoopCount operator is the same as the LoopCount for the inner-loop because this is the closest repetitive loop.</p>

<div class="wp_syntax"><div class="code"><pre class="aim" style="font-family:monospace;"><span style="color: #0000FF;">while</span> LoopCount <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">3</span> <span style="color: #0000FF;">do</span> <span style="color: #808080; font-style: italic ">&quot;outer-loop&quot;</span>
    <span style="color: #0000FF;">while</span> LoopCount <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">4</span> <span style="color: #0000FF;">do</span> <span style="color: #808080; font-style: italic ">&quot;inner-loop&quot;</span> 
        <span style="color: #990000; font-weight: bold;">dialogMessage</span><span style="color: #009900;">&#40;</span> <span style="color: #808080; font-style: italic ">&quot;Outer : &quot;</span> <span style="color: #339933;">+</span> LoopCount<span style="color: #009900;">&#40;</span><span style="color: #808080; font-style: italic ">&quot;outer-loop&quot;</span><span style="color: #009900;">&#41;</span> 
                       <span style="color: #339933;">+</span> <span style="color: #808080; font-style: italic ">&quot;\n&quot;</span>
                       <span style="color: #339933;">+</span> <span style="color: #808080; font-style: italic ">&quot;Inner : &quot;</span> <span style="color: #339933;">+</span> LoopCount<span style="color: #009900;">&#40;</span><span style="color: #808080; font-style: italic ">&quot;inner-loop&quot;</span><span style="color: #009900;">&#41;</span>
                       <span style="color: #339933;">+</span> <span style="color: #808080; font-style: italic ">&quot;\n&quot;</span>
                       <span style="color: #339933;">+</span> <span style="color: #808080; font-style: italic ">&quot;No string : &quot;</span> <span style="color: #339933;">+</span> LoopCount
                      <span style="color: #009900;">&#41;</span> ; 
    <span style="color: #0000FF;">endwhile</span> ; 
<span style="color: #0000FF;">endwhile</span> ;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/04/using-loopcount-instead-of-explicit-counting-parameter-in-loops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a custom splashscreen to your AIMMS application</title>
		<link>http://blog.aimms.com/2012/04/adding-a-custom-splashscreen-to-your-aimms-application/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-a-custom-splashscreen-to-your-aimms-application</link>
		<comments>http://blog.aimms.com/2012/04/adding-a-custom-splashscreen-to-your-aimms-application/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 12:03:19 +0000</pubDate>
		<dc:creator>Guido Diepen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[splashscreen]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=1052</guid>
		<description><![CDATA[After you are finished with creating your AIMMS application, you can deploy it to the people who will use your application. Instead of using the standard AIMMS splashscreen displayed on the right, you have the option to provide your own &#8230; <a class="more-link" href="http://blog.aimms.com/2012/04/adding-a-custom-splashscreen-to-your-aimms-application/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_1094" class="wp-caption alignright" style="width: 310px"><img src="http://blog.aimms.com/wp-content/uploads/2012/04/Default-AIMMS-Splashscreen-300x195.png" alt="Default splashscreen for AIMMS Developer" title="Default splashscreen for AIMMS Developer" width="300" height="195" class="size-medium wp-image-1094" /><p class="wp-caption-text">Default splashscreen for AIMMS Developer</p></div>After you are finished with creating your AIMMS application, you can deploy it to the people who will use your application. Instead of using the standard AIMMS splashscreen displayed on the right, you have the option to provide your own custom splashscreen.<br />
Please note that the splashscreen depicted is the splashscreen of the developer version of AIMMS. If the user of your application has an AIMMS end-user license, the purple background color will actually be green.</p>
<p><div id="attachment_1095" class="wp-caption alignleft" style="width: 310px"><img src="http://blog.aimms.com/wp-content/uploads/2012/04/Gate-Assignment-300x147.jpg" alt="Gate Assignment splashscreen" title="Gate Assignment splashscreen" width="300" height="147" class="size-medium wp-image-1095" /><p class="wp-caption-text">Gate Assignment splashscreen</p></div>You can instruct AIMMS to not display the standard splashscreen, but a custom one by creating a BMP file with the same name as the project file (i.e. the .prj file). If you open the Gate Assignment example from the index of all examples, you will see that splashscreen depicted on the left is.</p>
<p>The name of the .prj file of the gate assignment project is &#8220;Gate Assignment.prj&#8221;. By saving the above picture as &#8220;Gate Assignment.bmp&#8221; in the same folder as the &#8220;Gate Assignment.prj&#8221; file, AIMMS will now display the new splashscreen. Please note that you must use the bitmap (BMP) format, as AIMMS will only look for this extension (and not other image file formats).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/04/adding-a-custom-splashscreen-to-your-aimms-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Win on AIMMS Data Page</title>
		<link>http://blog.aimms.com/2012/03/quick-win-on-aimms-data-page/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quick-win-on-aimms-data-page</link>
		<comments>http://blog.aimms.com/2012/03/quick-win-on-aimms-data-page/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 22:29:38 +0000</pubDate>
		<dc:creator>Deanne Zhang</dc:creator>
				<category><![CDATA[Beginner]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=1055</guid>
		<description><![CDATA[AIMMS Data Page facilities directly view of the data associated with a particular identifier. With some clicks, drag &#38; drops, a data page can also be quickly modified to display one or more identifiers in different formats. A data page can be &#8230; <a class="more-link" href="http://blog.aimms.com/2012/03/quick-win-on-aimms-data-page/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>AIMMS Data Page facilities directly view of the data associated with a particular identifier. With some clicks, drag &amp; drops, a data page can also be quickly modified to display one or more identifiers in different formats.</p>
<p>A data page can be opened via the Data button, via the right mouse menu, or via shortcut key Ctrl + D for every global identifier.</p>
<p>Multi-dimensional parameters, variables and constraints are displayed in Pivot Table by default.  Using the <a href="http://blog.aimms.com/wp-content/uploads/2012/03/button.jpg"><img class=" wp-image-1056 alignnone" title="button" src="http://blog.aimms.com/wp-content/uploads/2012/03/button.jpg" alt="Viewing Mode Switching Button" width="16" height="14" /></a> button on the data page you can switch view among Pivot Table, Composite Table, Table, and Sparse List .  For example, the following is the Composite Table view of the 2-dimensional data &#8220;Transport&#8221; in the &#8220;Transport Model&#8221; example.</p>
<p><a href="http://blog.aimms.com/wp-content/uploads/2012/03/Composite.jpg"><img class="size-full wp-image-1056 alignnone" title="Composite Table" src="http://blog.aimms.com/wp-content/uploads/2012/03/Composite.jpg" alt="Composite Table View" /></a></p>
<p>On the above page, via the Selection Object on the top, you can select any given d (Depot) and c (Customer) to view the value.</p>
<p>If you want to add other identifiers to the same table, for example, adding &#8220;UnitTransportCost&#8221; to the above table, you can easily do so in three steps: 1. Switch the data page to &#8220;Edit&#8221; Mode; 2. select &#8220;UnitTransportCost&#8221; in the Model Explorer by mouse; 3. drag and drop &#8220;UnitTransportCost&#8221; to the table.</p>
<p><a href="http://blog.aimms.com/wp-content/uploads/2012/03/Drag-ID.jpg"><img class="size-full wp-image-1056 alignnone" title="Drag UnitTransportCost" src="http://blog.aimms.com/wp-content/uploads/2012/03/Drag-ID.jpg" alt="Drag UnitTransportCost" /></a></p>
<p>After mouse releases, you will see &#8220;UnitTransportCost&#8221; shows in the table.</p>
<p><a href="http://blog.aimms.com/wp-content/uploads/2012/03/Drop.jpg"><img class="wp-image-1059 alignnone" title="Drop" src="http://blog.aimms.com/wp-content/uploads/2012/03/Drop.jpg" alt="Updated Table" width="851" height="580" /></a></p>
<p>You can add an identifier to other types of table in the same way. And in page Edit Mode, you can change other properties of the table in the table Properties Dialog, for example, adding or removing suffices, editing format, etc.</p>
<p>After the changes, you can save the modified data page. The saved data page will appear under All Data Pages section in the Page Manager.</p>
<p><a href="http://blog.aimms.com/wp-content/uploads/2012/03/DataPage.jpg"><img class="wp-image-1060 alignnone" title="DataPage" src="http://blog.aimms.com/wp-content/uploads/2012/03/DataPage.jpg" alt="Updated Data Page" width="851" height="560" /></a></p>
<p>Please note if a modified data page exists, which is with format &#8220;[Data Page] Identifier Name&#8221;,  AIMMS will use this page as the data page for that identifier. In order to view the default data page,  you need to hold down the Shift key while opening the data page, or remove the data page from the All Data Pages section.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/03/quick-win-on-aimms-data-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minimizing objective containing a min-operator</title>
		<link>http://blog.aimms.com/2012/03/minimizing-objective-containing-a-min-operator/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=minimizing-objective-containing-a-min-operator</link>
		<comments>http://blog.aimms.com/2012/03/minimizing-objective-containing-a-min-operator/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 15:01:28 +0000</pubDate>
		<dc:creator>Guido Diepen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[modeling]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=860</guid>
		<description><![CDATA[During the last couple of months I saw the exact same question from different customers, namely that they wanted to minimize an objective that contained a binary min operator. For example, the minimization objective contained the following term: 50 * &#8230; <a class="more-link" href="http://blog.aimms.com/2012/03/minimizing-objective-containing-a-min-operator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>During the last couple of months I saw the exact same question from different customers, namely that they wanted to minimize an objective that contained a binary min operator. For example, the minimization objective contained the following term: </p>
<blockquote><p>
50 * min( aParameter, aVariable).
</p></blockquote>
<p>The idea of using this binary min operator was to introduce a ceiling to the contribution of a variable to the objective. Recently, I also saw a similar topic being discussed by <a href="http://yetanothermathprogrammingconsultant.blogspot.com/" title="Erwin Kalvelage">Erwin Kalvelagen</a> in his <a href="http://yetanothermathprogrammingconsultant.blogspot.com/2012/02/max-tricks.html" title="max tricks">max tricks blog post</a>.</p>
<p>If you want to keep your problem linear, you cannot make use of the min operator directly in a constraint, so you will have to work around it with some modelling. You can do this introducing a new variable <strong>min_param_var</strong>, that will be forced to have a value equal to the binary min-operator by using  additional constraints. This new variable will replace the original &#8220;min( aParameter, aVariable)&#8221; term in the objective (and thus will have coefficient of 50 in objective in the above example).</p>
<p>Furthermore, we also need a new binary variable <strong>param_smaller_than_var</strong>, that will get the value 1 if the value of the parameter is smaller than the value of the variable and 0 otherwise.</p>
<p>Finally, we also need to add two constraints and a big-M to the model to ensure the newly introduced variables get the correct values. The value of the big-M should be a sufficiently large value, which in this particular case is max( aParameter, aVariable.upper ).</p>
<p>The 2 constraints you will have to add are:</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=%5Cmathrm%7Bmin%5C_param%5C_var%7D+%5Cge+%5Cmathrm%7BaParameter%7D+%2A+%5Cmathrm%7Bparam%5C_smaller%5C_than%5C_var%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{min&#92;_param&#92;_var} &#92;ge &#92;mathrm{aParameter} * &#92;mathrm{param&#92;_smaller&#92;_than&#92;_var}' title='&#92;mathrm{min&#92;_param&#92;_var} &#92;ge &#92;mathrm{aParameter} * &#92;mathrm{param&#92;_smaller&#92;_than&#92;_var}' class='latex' /></li>
<li><img src='http://s0.wp.com/latex.php?latex=%5Cmathrm%7Bmin%5C_param%5C_var%7D+%5Cge+%5Cmathrm%7BaVariable%7D+-+%5Cmathrm%7Bparam%5C_smaller%5C_than%5C_var%7D+%2A+M&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{min&#92;_param&#92;_var} &#92;ge &#92;mathrm{aVariable} - &#92;mathrm{param&#92;_smaller&#92;_than&#92;_var} * M' title='&#92;mathrm{min&#92;_param&#92;_var} &#92;ge &#92;mathrm{aVariable} - &#92;mathrm{param&#92;_smaller&#92;_than&#92;_var} * M' class='latex' /></li>
</ul>
<p>If the variable <strong>min_param_var</strong> has a positive component in the objective, the solver will try to minimize the value of the variable <strong>min_param_var</strong> and the above constraints will ensure that the variable <strong>param_smaller_than_var</strong> will automatically get the value 1 if aParameter <= aVariable and 0 otherwise.</p>
<p>By filling in some values for the parameter and the variable in the above constraints, you can verify that the binary variable must indeed get the correct value to ensure that the min_param_var variable will get the smallest value possible.</p>
<p><strong>Additional information</strong>: In case you are minimizing an objective that contains a binary max operator, you can use a similar approach. However, in this case you do not need the big-M, but only one additional variable max_param_var and two constraints:</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=%5Cmathrm%7Bmax%5C_param%5C_var%7D+%5Cge+%5Cmathrm%7BaParameter%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{max&#92;_param&#92;_var} &#92;ge &#92;mathrm{aParameter}' title='&#92;mathrm{max&#92;_param&#92;_var} &#92;ge &#92;mathrm{aParameter}' class='latex' /></li>
<li><img src='http://s0.wp.com/latex.php?latex=%5Cmathrm%7Bmax%5C_param%5C_var%7D+%5Cge+%5Cmathrm%7BaVariable%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{max&#92;_param&#92;_var} &#92;ge &#92;mathrm{aVariable}' title='&#92;mathrm{max&#92;_param&#92;_var} &#92;ge &#92;mathrm{aVariable}' class='latex' /></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/03/minimizing-objective-containing-a-min-operator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting AimmsInterrupt tool from installation-free AIMMS</title>
		<link>http://blog.aimms.com/2012/03/starting-aimmsinterrupt-tool-from-installation-free-aimms/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=starting-aimmsinterrupt-tool-from-installation-free-aimms</link>
		<comments>http://blog.aimms.com/2012/03/starting-aimmsinterrupt-tool-from-installation-free-aimms/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 19:53:42 +0000</pubDate>
		<dc:creator>Guido Diepen</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[aimmsinterrupt]]></category>
		<category><![CDATA[InstallationFree]]></category>
		<category><![CDATA[interrupt]]></category>

		<guid isPermaLink="false">http://blog.aimms.com/?p=1000</guid>
		<description><![CDATA[In some of the posts I have mentioned the AimmsInterrupt tool already. If you install a recent version of AIMMS, this tool will also be installed and is made available for starting via the Start Menu. However, if you only &#8230; <a class="more-link" href="http://blog.aimms.com/2012/03/starting-aimmsinterrupt-tool-from-installation-free-aimms/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_602" class="wp-caption alignright" style="width: 258px"><img src="http://blog.aimms.com/wp-content/uploads/2012/01/screenshot_aimmsinterrupt.png" alt="Screenshot AimmsInterrupt" title="Screenshot AimmsInterrupt" width="248" height="128" class="size-full wp-image-602" /><p class="wp-caption-text">Screenshot AimmsInterrupt</p></div>In some of the posts I have mentioned the AimmsInterrupt tool already. If you install a recent version of AIMMS, this tool will also be installed and is made available for starting via the Start Menu.</p>
<p>However, if you only make use of installation-free versions of AIMMS, nothing is added to the Start Menu, meaning there is no direct way to start the tool. Luckily, it is still possible to start the AimmsInterrupt tool from within AIMMS itself. If you start an installation-free version of AIMMS you can put the following statement in a procedure:</p>

<div class="wp_syntax"><div class="code"><pre class="aim" style="font-family:monospace;"><span style="color: #990000; font-weight: bold;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #808080; font-style: italic ">&quot;c:\\Program Files\\Paragon Decision Technology\\Common\\Bin\\AimmsInterrupt.exe&quot;</span><span style="color: #009900;">&#41;</span> ;</pre></div></div>

<p>When you execute this procedure, the AimmsInterrupt tool will be started, from which you can now interrupt any of the AIMMS sessions that is running.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aimms.com/2012/03/starting-aimmsinterrupt-tool-from-installation-free-aimms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

