@FILE和@TEXT:文本文件输入输出
MODEL:
SETS:
MYSET / @FILE(‘myfile.txt’) / : @FILE(‘myfile.txt’);
ENDSETS
MIN = @SUM( MYSET( I):
SHIP( I) * COST( I));
@FOR( MYSET( I):
[CON1] SHIP( I) > NEED( I);
[CON2] SHIP( I) < SUPPLY( I));
DATA:
COST = @FILE(‘myfile.txt’);
NEED = @FILE(‘myfile.txt’);
SUPPLY = @FILE(‘myfile.txt’);
@TEXT(‘result.txt’)=SHIP, @DUAL(SHIP), @DUAL(CON1);
ENDDATA
END
myfile.txt文件
的内容、格式:
Seattle,Detroit,Chicago,Denver~
COST,NEED,SUPPLY,SHIP~
12,28,15,20~
1600,1800,1200,1000~
1700,1900,1300,1100
演示 MyfileExample.lg4
1