0
林加载从OPL工作室的数据文件2由两个矩阵,现在用的是下面的脚本如何在OPL ILOG Studio上正确加载2乘2矩阵而不出错?
P=5;
Customers={"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50"};
Warehouses={"A","B","C","D","E"};
Demand=[3,14,1,14,19,2,14,6,7,6,10,18,3,6,20,4,14,11,19,15,15,4,13,13,5,16,3,7,14,17,3,3,12,14,20,13,10,9,6,18,7,20,9,1,8,5,1,7,9,2];
prepare {
function read(element, name) {
var customDataSource =
IloOplCallJava("externaldatasource.SimpleTextReader","<init>", "(Ljava.lang.String;Ljava.lang.String;)V","C:/Users/Brian/opl/ccp/data.txt", ",");
customDataSource.fillOplElement(element);
return true;
}
}
Distance = invoke read;
即时得到一个“数据解析错误:语法错误,意想不到的准备,期待$结束” 我想从文件中的数据加载具有以下格式,并从文件中读取到OPL工作室
0 86 42 67 54 76 78 107 100 57
42 93 44 21 25 35 56 16 60 101
10 54 58 72 82 60 58 72 43 67
70 15 36 61 102 14 69 64 23 83
19 52 94 10 62 50 69 53 52 4
86 0 76 23 47 18 60 23 16 51
70 7 62 97 63 75 51 70 37 19
75 49 74 27 32 71 28 30 47 43
42 86 72 80 16 77 21 46 63 6
94 81 15 78 62 87 47 72 42 85
我公司开发上述使用OPL文件