Code Monkey home page Code Monkey logo

rampl's Introduction

rAMPL

Build Status build-and-test

AMPL API is an interface that allows developers to access the features of the AMPL interpreter from within a programming language. All model generation and solver interaction is handled directly by AMPL, which leads to great stability and speed; the library just acts as an intermediary, and the added overhead (in terms of memory and CPU usage) depends mostly on how much data is read back from AMPL, the size of the model as such is irrelevant. Functions for directly assigning data to AMPL parameters and sets are provided, which can be used instead of the normal AMPL data reading procedures. AMPL API has been written with usability in mind, and it is easy to access its functionalities from C++, Java, C#, MATLAB, Python, and R.

The AMPL API can function as an add-on to any existing AMPL installation. If you do not yet have an AMPL installation on the computer where you will be working with the API. Use our Community Edition to download a working version that can be installed quickly.

Documentation

Setup

In order to install the latest version of the R API you just need to run:

> install.packages("Rcpp", type="source")
> install.packages("https://ampl.com/dl/API/rAMPL.tar.gz", repos=NULL)

Note: this package requires R development tools on Windows and macOS, which can be installed as follows:

Alternatively, you can download, build, and install the package locally:

$ git clone [email protected]:ampl/rAMPL.git
$ cd rAMPL
$ python updatelib.py
$ cd ..
$ R CMD build rAMPL 
$ R CMD INSTALL rAMPL_<version>.tar.gz

License

BSD-3


Copyright © 2023 AMPL Optimization inc. All rights reserved.

rampl's People

Contributors

fdabrandao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rampl's Issues

rampl_reading_data_defined_in_R_through_tables

Hello,

I need some help regarding the link between ampl and R;

All my data is already prepared in tables in R.

I was wondering if these data can be directly read by ampl code through the same R code, where I defined the inputs as tables.

Thank you,

A typo in 'rAMPL/docs/source/getting-started.rst'

Thanks for the nice AMPL R API :D
The following line of code to add AMPL binary location to 'PATH' used ';' as the separator whereas the default separator for PATH on Unix is ':'. This raises “AMPL could not be started” error when creating AMPL class later on.

 Sys.setenv(PATH = paste(Sys.getenv("PATH"), "full path to the AMPL installation directory", sep = ";"))

Makevars not working on mac

The Makevars doesn't work on my mac, i got the following error :

clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -L/Users/user_name/opt/clang+llvm-4.0.1-x86_64-apple-macosx10.9.0/lib -lomp -o rAMPL.so RcppExports.o rampl.o rcon_entity.o rcon_instance.o renvironment.o robj_entity.o robj_instance.o rparam_entity.o rset_entity.o rset_instance.o rvar_entity.o rvar_instance.o utils.o -L../inst/libs/x64 -L../inst/libs/i386 -lampl -Wl,-rpath,@loader_path/../libs/x64 -Wl,-rpath,$ORIGIN/../libs/x64 -Wl,-rpath,$ORIGIN/../libs/i386 -Wl,-rpath,$ORIGIN/../inst/libs/x64 -Wl,-rpath,$ORIGIN/../inst/libs/i386 SHLIB_LIBADD = -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
clang: error: no such file or directory: 'SHLIB_LIBADD'
clang: error: no such file or directory: '='
make: *** [rAMPL.so] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.