ampl / amplpy

Python API for AMPL

Home Page:https://amplpy.ampl.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warnings and Keyerror in ampl eval

Prashanthrajagopal91 opened this issue · comments

Hello,

I am trying to use the %%ampl_eval fn define my objectives and variables. But it seems like throwing a warning that its not defined. Note I have installed the recent one using

!pip install "amplpy>=0.8.2b0" --upgrade --pre

image

Also there is a keyword error although my dataset contains the mentioned keywords,

Screen Shot 2023-04-06 at 9 13 29 AM

Could you please help me understand this better? Thanks!

Hi @Prashanthrajagopal91,

In that ampl_eval section you use R_min, R_max, etc. but I don't see their declarations. Are they declared somewhere else? They need to be declared before they are used as follows:

param R_min;
param R_max;
var R >= R_min, <= R_max;