Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

AMPL not running

$
0
0

`# Define the set of boxesset BOXES := 1..8;

reset; # Clears all previous AMPL definitions

set TRUCKS := 1..2;

param Volume :=1 302 603 704 205 106 107 508 50;

param Priority :=1 2 # Box 1 has priority 2 (Food)2 3 # Box 2 has priority 3 (Urgent)3 2 # Box 3 has priority 2 (Food)4 2 # Box 4 has priority 2 (Food)5 3 # Box 5 has priority 3 (Urgent)6 3 # Box 6 has priority 3 (Urgent)7 1 # Box 7 has priority 1 (None)8 4; # Box 8 has priority 4 (Urgent Food)

var x{BOXES, TRUCKS} binary;

maximize TotalPriority: sum{i in BOXES, j in TRUCKS} Priority[i] * x[i,j];

subject to VolumeConstraint{j in TRUCKS}:140 <= sum{i in BOXES} Volume[i] * x[i,j] <= 160;

subject to OneTruckEach{i in BOXES}:sum{j in TRUCKS} x[i,j] = 1;`

#Questionwhy am I facing this error when executing my code?ampl: model Assingment_3.mod;

Assingment_3.mod, line 11 (offset 202):syntax errorcontext: 1 >>> 30 <<<


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>