cplex

Using OPL CPLEX in Excel VBA?

橙三吉。 提交于 2019-12-12 02:51:58
问题 I'd like to call OPL CPLEX and solve problems in a program coded on Excel VBA. I want to create an OPL model and, load .mod and .dat file into that model. After a long search process on the internet, I came up with some lines of script below released on IBM website. Sub CPLEXCallHere() 'To create the Concert environment Dim oplF As Oplfactory 'To create the error handler Dim errorHandler As OplErrorHandler 'To identify the model source Dim modelSource As OplModelSource 'To identify the model

read CSV file in Cplex

与世无争的帅哥 提交于 2019-12-11 15:56:37
问题 my question is related to my previous question. I should make some change in my code. I have a number of nodes between 1 to 100 in the CSV file. I create another CSV file and generate 20 random numbers between the 100 nodes and called them demand points. Each of this demand point has specific demands which are the randomly generate numbers between 1 to 10. I want to read this demand points(the indexes) and their weights. this is the first part of my question? how can I read this? After that,

Setting parameters in pyomo

廉价感情. 提交于 2019-12-11 15:41:55
问题 I am using CPLEX with pyomo . I would like to set the parameter mip.limits.solutions = 1 . How to do this with either .options( or .set_options( or any other way? I have tried the following but nothing works: from pyomo.environ import * opt = SolverFactory("cplex") opt.set_options('miplimitssolutions=1') # does not work opt.set_options('mip.limits.solutions=1') # does not work opt.options['mip'] = 'limits' # this works up to here but how to continue? 回答1: Pyomo's (LP file-based) CPLEX

What does this array initialisation mean? CPLEX

情到浓时终转凉″ 提交于 2019-12-11 15:22:33
问题 I am very new to CPLEX and am trying to understand a friends example so i may produce a model myself, however I am confused as to how one of the decision variables has been created. The notation is unfamiliar to me and also the fact that they are using a set of tuples as well as ranges in it's definition. Any help explaining what is going on and what the line of code does would be greatly appreciated. tuple bus{int busnumber; float capacity; string start_location; string stop_location; int

Goal Programming in Cplex

核能气质少年 提交于 2019-12-11 13:22:50
问题 Let's say I have the two goals. I want to reach that goals really close: i=1) profit goal: 12𝑥 + 9y ≥ 125 i=2) cost-goal: 5𝑥 + 7y ≤ 50 In the literature you can do goal-programming by inserting variables, which represent deviations. Let's say the variable ai is the deviation above the goal value from goal I and bi is the deviation below the goal value from goal I. You get the following constraints: 12𝑥 + 9y -a1 + b1 = 125 5𝑥 + 7y -a2 + b2 = 50 In the last step you create the objective

cplex.linear_constraints.add too slow for large models

半世苍凉 提交于 2019-12-11 10:49:28
问题 I've been trying to use cplex to solve an optimal transportation problem. The problem model is normally very large (in my description below the total number of variables are 1048576 (= 1024^2), and the number of constraints is 2048). My problem is that the process of adding constraints is far too slow to be practical ( the time spent in solving the model is fine though). I googled this issue, there are some tips, but still I couldn't find a feasible solution. The problem is as follows: Given

AMPL: does the results after using the option “timelimit” for cplex meet all the constraints?

99封情书 提交于 2019-12-11 09:27:20
问题 I have a dummy question that I need to know its answer. I'm working on a project that requires AMPL and CPLEX as a solver. Now this problem normally takes more than 140 seconds to be solved. While I was searching, I came into an option called timelimit . I used this option with value option cplex_options 'timelimit=5' and the results were shown within 5 seconds. Now my questions is, does the output meet all the constraints and is within the boundaries I set in the code? Or did I just

Cplex(number of decimal)

青春壹個敷衍的年華 提交于 2019-12-11 07:54:15
问题 enter image description herehi, how can I increase the number of digits after the comma (number of decimal) in CPLEX for objectif fonction? thank you cordially? 回答1: You could read this CPLEX technote: http://www-01.ibm.com/support/docview.wss?uid=swg21615825 I gave the example float f = sqrt(2); execute { function formatFloat_prec8 (f) { f = Math.round(f*100000000); var fs = f.toString(); fs = fs.substring(0,fs.length-8)+','+fs.substring(fs.length-8,fs.length); return fs; } writeln

IBM Optimization Studio OPL, why constraint is not respected?

不羁的心 提交于 2019-12-11 06:46:39
问题 Here is a description of the optimization problem I need to solve, but with a small twist. I need to add two constraints: The first constraint: From each group we want to choose only one product, which means that we can't allow two products from the same group to be in the same basket(i.e. Product11 and Product12 should never be in the same basket ) The second constraint: In the user basket we only want products from the categories that the user is interested in. i.e if user is interested in

How to inlclude JavaDoc for CPLEX API in a maven project?

余生长醉 提交于 2019-12-11 04:48:53
问题 How can I include the Cplex JavaDoc in my maven project to get code assistant on the Cplex Java API? 回答1: The javadoc can be found here: {PATH_TO_CPLEX_INSTALLATION_FOLDER}/doc/html/en-US/refjavacplex/html/ For non maven projects you can reference that path directly in the project settings. For maven projects you can put that files into a javadoc jar file: Open the CommandLine and navigate to the folder, e.g. cd C:/Program%20Files/IBM/ILOG/CPLEX_Enterprise_Server126/CPLEX_Studio/doc/html/en