Questions tagged [amplpy]

AMPL API is an interface that allows developers to access the features of the AMPL interpreter from within a programming language.

6 questions
4
votes
2 answers

How do I fix the amplpy error on search path?

I have recently installed Amplpy for python 3.6.5 (win 32 bit), but I am facing the following issue: Please make sure that the AMPL folder is in the system search path, or specify the path via: AMPL(Environment('full path to the AMPL installation…
Poulad
  • 41
  • 1
3
votes
1 answer

Specifying default values

I have a parameter B in matrix format, defined in the model file as param B {Rn,Rn}; for which I define the non-sparse values as from numpy import random from scipy import sparse from amplpy import AMPL, Environment, dataframe B =…
FooBar
  • 15,724
  • 19
  • 82
  • 171
1
vote
1 answer

amplpy: how to define data to a parameter associated with a set

I'm trying to use amplpy to link a python script to a ampl model, and the real desire is use a script to generate some parameters, and use the ampl to find the optimal values to some variables. Worth mentioning that the model works fine alone, no…
1
vote
1 answer

Amplpy: How to use output handler?

I am new in AMPL and Python and I am using amplpy to run an AMPL model, using lpopt solver. I need to get the output result of the solver in a way that I can act over it, i.e. I need to know if the optimal solution was found to decide if I can use…
matrj
  • 21
  • 4
1
vote
1 answer

AMPLPY decrypt and encrypt

I am using amplpy to access AMPL from my python. I want my dat file to not be in plain text. Is it possible? I cannot find any api to do it
user903772
  • 1,554
  • 5
  • 32
  • 55
0
votes
2 answers

How to map indices of different sets in pyomo?

I have two sets in Pyomo, the first one is G=/GD1,GD2,GD3/, And the second one is N=/N1,N2,N3,...,N32,N33/. Naturally they have symbolic representation here for the sake of simplicity. I would like to map G into N, in order to define the relation…