Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2013-01-08T09:49:39Z by AlexFleischer
SystemAdmin
SystemAdmin
1883 Posts
ACCEPTED ANSWER

Pinned topic fill parameters reading from a file .dat

‏2013-01-06T16:31:02Z |
Hi, I have a problem with these two variables:
int costPTi in T=...;
int costSTi in T=...;

if I have two .dat files with the values I want to put in these parameters

procs.dat

example:
procs =

9
10
5
1
11
19
6
17
7

and
slots.dat

how can I do it? is there any function in cplex that opens a file and assigns line values to vector values? I wouldn't like to use any random function from cplex as I want to use these values with other programs

thank you
Updated on 2013-01-08T09:49:39Z at 2013-01-08T09:49:39Z by SystemAdmin
  • AlexFleischer
    AlexFleischer
    1130 Posts
    ACCEPTED ANSWER

    Re: fill parameters reading from a file .dat

    ‏2013-01-08T09:49:39Z  in response to SystemAdmin
    Hi,

    in a.mod file you can write

    range T=1..9;
    int costPTi[T]=...;
    


    and then in a.dat file

    costPTi=[
    9,
    10,
    5,
    1,
    11,
    19,
    6,
    17,
    7];
    


    oplrun a.mod a.dat will link the 2

    regards
    Updated on 2014-03-26T05:51:21Z at 2014-03-26T05:51:21Z by AlexFleischer