Originally posted by: SystemAdmin
This is part of my code:
{string} requests =...;
{string} links =...;
{string} VM=... ;
{string} paths =...;
{string} resources = ...;
{string} sources
requests= ...;
{string} destination
requests = ...;
{string} VM_no_node = ...;
{string} VM_node = ...;
string temp_s;
string temp_d;
int server_num = ...;
int server_no_node = ...;
int node_server = ...;
range server_nonode = 1..server_no_node;
range server_node = 11..node_server;
range server = 1..server_num;
int a
requests,paths=... ;
int b
server,server,paths=... ;
int t
requests=... ;
int h =...;
int r
requests=...;
int M
serverresources=...;
int K
VMresources = ...;
int TARD = ...;
temp_s == first(sources);
temp_d == first(destination);
dvar int St
requests;
dvar int X
VM,server;
dvar boolean Y
requests,paths;
dvar boolean W
requests,requests;
minimize
sum (rq in requests) (St
rq-r
rq) ;
subject to {
.....
forall(i in requests)
{
forall(q,c in server:q!=c)
{
forall(p in paths)
{
temp_s = next(sources[i],temp_s);
(3*Y[i][p]-(X
temp_s[q]+X
temp_d[q]+b[q][c][p]))<=0;
temp_s = next(sources[i],temp_s);
temp_d = next(destination[i],temp_s);
}
}
}
....
}
I tried to use the first and the next method, but also it does not work,
Is there any method in which I can assign a string value to another string?
I need to vary term X
temp_s[q] over the temp_s without using the forall, where temp_s will be one of the elements of the set of source that contains the VM.
Thanks a lot
#DecisionOptimization#OPLusingCPOptimizer