Originally posted by: meletis13forever
Hello,
I have these tuples in my model and I want to generate random variables near the base station for my terminals (base station is the first item in the tuple infratuple. The other are femtocells.) in a script block.
tuple terminaltuple{
key string name;
int x;
int y;
float maxBW;
{float} availBW;
}
{terminaltuple} terminal=...;
terminaltuple dummy;
tuple infratuple{
key string name;
int x;
int y;
{float} PL;
float maxPower;
float cap;
}
{infratuple} infra=...;
The script block I have is this:
execute{
writeln(terminal);
for(var t in terminal){
dummy.x=100000;
dummy.y=100000;
while((infra(1).x-dummy.x)^2 + (infra(1).y-dummy.y)^2 >= 500.0){
dummy.x=875+Opl.rand(30);
dummy.y=268+Opl.rand(30);
//writeln("testing- xter="+dummy.xter + ";yter="+dummy.yter);
}
t.x=dummy.x;
t.y=dummy.y;
writeln("success adding "
t.name" "
t.x" "+t.y);
}
}
This script don't work. Can you help me?
Here is the data file:
terminal = { <", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}>,
<", 0, 0, 1024, {64, 128, 256, 384, 512, 1024}> };
infra = { <", 885, 278, {1.0}, 60.0, 3700.0>,
<", 835, 211, {0.5, 0.6, 0.7, 0.8, 0.9, 1}, 0.12, 10000.0>,
<", 326, 426, {0.5, 0.6, 0.7, 0.8, 0.9, 1}, 0.12, 10000.0>,
<", 825, 298, {0.5, 0.6, 0.7, 0.8, 0.9, 1}, 0.12, 10000.0>,
<", 927, 334, {0.5, 0.6, 0.7, 0.8, 0.9, 1}, 0.12, 10000.0>,
<", 933, 222, {0.5, 0.6, 0.7, 0.8, 0.9, 1}, 0.12, 10000.0>,
<", 869, 358, {0.5, 0.6, 0.7, 0.8, 0.9, 1}, 0.12, 10000.0>,
<", 938, 275, {0.5, 0.6, 0.7, 0.8, 0.9, 1}, 0.12, 10000.0>,
<", 881, 276, {0.5, 0.6, 0.7, 0.8, 0.9, 1}, 0.12, 10000.0> };
#DecisionOptimization#MathematicalProgramming-General