Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.
/ inf170 Public archive

Assignments and exercises from the course INF170 at the University of Bergen

Notifications You must be signed in to change notification settings

oyvinddd/inf170

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AMPL (A Mathematical Programming Language)

Introduction

AMPL is an algebraic modelling language to describe and solve high-complexity problems for large-scale mathematical computing (i.e., large-scale optimization and scheduling-type problems).

This repository contains my answers to the exercises at the end of each chapter in the AMPL book.

Syntax

Some basic syntax used in AMPL.

# A set (which can be iterated over)
set PRODUCTS;

# A parameter on the set of products
# (a given profit is defined for each product in the set)
param profit {PRODUCTS};

# A 'global' parameter (i.e. number of working hours available in a week)
# Parameters can be initialized with lower and upper bounds (<=, >=)
pram avail >= 0;

# Decision variable
var Make {PRODUCTS};

# Objective function. We'll want to either maximize or minimize this.
maximize Total_Profit: sum {p in PRODUCTS} Make[p] * profit[p];

# The objective is subject to one ore more constraints
subject to Time: sum {p in PROD} (1/rate[p]) * Make[p] <= avail;

About

Assignments and exercises from the course INF170 at the University of Bergen

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published