Plot 为各种不同的网络运行SCIMP

Plot 为各种不同的网络运行SCIMP,plot,linear-programming,scip,Plot,Linear Programming,Scip,我有一个线性程序,我可以输入n的数字,它给我这个特定n的LP的输出。我想现在对各种n=10…1000做这个。是否有一种技术,我不必手动对每个n进行fpr,而是自动执行此操作,并在文件中为每个n输出LP的解决方案?我喜欢稍后绘制图表 这是我的线性规划: #Specify the number of n for the linear program. param n := 5000; #This is the set of probabilities of set N := {1 .. n};

我有一个线性程序,我可以输入n的数字,它给我这个特定n的LP的输出。我想现在对各种n=10…1000做这个。是否有一种技术,我不必手动对每个n进行fpr,而是自动执行此操作,并在文件中为每个n输出LP的解决方案?我喜欢稍后绘制图表

这是我的线性规划:

#Specify the number of n for the linear program.
param n := 5000;

#This is the set of probabilities of 
set N := {1 .. n};
#We specify the variables for the probabilities p_1,...p_n.
var p[<i> in N] real >= 0; 

#These are the values of the vector c. It specifies a constant for each p_i.
param c[<i> in N] := i/n ;

#We define the entries a_{ij} of the Matrix A.
defnumb a(i,j) := 
            if i < j then 0 
            else if i == j then i 
            else 1 end end;

#The objective function.
maximize prob: sum <i> in N : c[i] * p[i];

#The condition which needs to be fulfilled.
 subto condition:
    forall <i> in N:
      sum <j> in N: a(i,j) * p[j] <= 1;
#指定线性程序的n个数。
参数n:=5000;
#这是一组
集合N:={1..N};
#我们指定概率p_1,…p_n的变量。
var p[N]实值>=0;
#这些是向量c的值。它为每个p_i指定一个常数。
参数c[in N]:=i/N;
#我们定义矩阵a的条目a{ij}。
解数a(i,j):=
如果iN:a(i,j)*p[j]中的和可以通过控制台使用以下参数给出参数:

-D n=[number you want] -o [output file]
然后您可以通过使用shell脚本来迭代几个n,例如

for i in {1..100}
do
 zimpl -D n=$i -o 'output_'$i yourfile.zpl
done