Tags:
create new tag
view all tags
<!-- Ready to Review --> ---+<a name="top"></a> Objective Functions in AMPL 1 [[#describe][Description]] 2 [[#declare][Declaring an Objective Function]] 3 [[#define][Defining an Objective Function]] ---++<a name="describe"></a> Description The objective function of a mathematical programme is a function of the decision variables that measures the "worth" of the decisions. This "worth" is being either maximised or minimised (although, if no objective function is defined, AMPL will use the solver to search for a feasible solution). [[#top][Return to top]] ---++<a name="declare"></a> Declaring an Objective Function Objective functions are declared using either the =minimize= or =maximize= keyword and a label: <pre> minimize TotalCost; </pre> [[#top][Return to top]] ---++<a name="define"></a> Defining an Objective Function Objective functions are usually defined when they are declared, e.g., <pre> minimize TotalCost: sum {i in INGREDIENTS} Cost[i] * Amount[i]; </pre> However, in some cases (such as when models are defined by column), the objective function is defined later <pre> minimize TotalWorkers; var Work {j in SCHEDS} >= 0, integer, obj TotalWorkers 1, ... ; </pre> [[#top][Return to top]] -- Main.MichaelOSullivan - 02 Mar 2008
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-03-02
-
MichaelOSullivan
Home
Site map
Forum web
Main web
NDSG web
ORUA web
OpsRes web
Sandbox web
TWiki web
OpsRes Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback