Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AMPL cannot find "minos"

I've faced a problem with AMPL. I'm using 32-bit version of Linux OS. I'm trying to solve a simple linear programmin problem but I can't understand what is wrong... Here is model, data files and session script as well. The answer to command "solve" is: Cannot find "minos". But the solver is currently in my folder! Changing the solvers doesn't help. Any suggestions?

Model of the problem:

param n;
param t;
param p{i in 1..n};
param r{i in 1..n};
param m{i in 1..n};
#Declaration of variables
var x {i in 1..n} >=0;
#Objective Function
maximize revenues: sum {i in 1..n} p[i]*x[i] ;
#Constraints
subject to Aval_Time: sum{i in 1..n} x[i]/r[i]<=t;
subject to Max_Flavor {i in 1..n}: x[i]<=m[i];

Data of the problem:

param n := 4;# No of Flavors
param t := 40; # Total labor hour in a week
param p := 1 1 2 1.5 3 1 4 1.5; # Revenue per package flavor i
param r := 1 40 2 30 3 50 4 20; # Production rate of package flavor i
param m := 1 1000 2 900 3 500 4 800; # Maximum demand package flavor i

AMPL session:

reset;
model example2.mod;
data example2.dat;
solve;
display x;

Answer of the system:

Cannot find "minos"

like image 304
Roman Dryndik Avatar asked Mar 16 '13 17:03

Roman Dryndik


2 Answers

The error message is trying to tell you that the solver is missing. AMPL doesn't solve your problem, it just transforms your model into a form suitable for the solver, passes that to the solver and the actual solution is done by the solver. That is about the error message.

You need a solver to resolve this issue. Download and the extract the minos solver. Make it exectuable: In the Bash shell (not the AMPL shell) issue the following:

chmod +x minos

You also have tell AMPL where the solver is before you issue the solve; command. Before the solve command, issue this either in the AMPL shell or in your model file:

option solver "/path/to/minos";

where you change /path/to/minos according to your installation.

That's all.

like image 166
Ali Avatar answered Oct 14 '22 15:10

Ali


On Unix and Unix-like operating systems such as Linux, the current directory is usually not on the search path. You have the following options:

  • Use option solver './minos'; before the solve command.
  • Similar to above but use the absolute path to minos as suggested by Ali.
  • Add the path to AMPL directory to the PATH environment variable.
  • Copy (or create a symbolic link) minos to some directory on the search path such as /usr/local/bin
like image 44
vitaut Avatar answered Oct 14 '22 15:10

vitaut