Dear Shaghayegh, glpsol cannot iterate over multiple models or data sets by itself.
https://en.wikibooks.org/wiki/GLPK/Scripting_plus_MathProg shows how to use a scripting language to call glpsol multiple times. You can pass the seed value for the random number generator like this glpsol --seed SEEDVALUE In Visual Basic Script you can create random numbers with the Rnd(1) function, cf https://msdn.microsoft.com/en-us/library/f7s023d2%28v=vs.90%29.aspx In awk you can use function rand() to create random numbers. Best regards Heinrich Schuchardt On 22.07.2015 01:12, Shaghayegh Mokarami wrote: > Hi > > Im new on GLPK, I want to test my simple model, I use this comment to > generate different random data: > > param seed:=gmtime(); > param u{(i,j) in E}:=(round(seed*Uniform01())) mod 40 ; > > and I want to solve model for 100 times and obtain the average value of > optimal value of objective function. > > I don't know how to code iterated expression to repeat solving model in .mod > file. Could you please help me? > > This is my model: > > ### VARIABLES ### > var x{(i,j) in E} >= 0, <= u[i,j]; > ### OBJECTIVE ### > maximize Val: sum {(1,j) in E} x[1,j]; > ### CONSTRAINTS ### > subject to Balance {i in V diff {1,n}}: > sum {(j,i) in E} x[j,i] = sum {(i,k) in E} x[i,k]; > solve; > > > > > _______________________________________________ > Help-glpk mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/help-glpk > _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
