Hi guys,
What do you recommend to do in this situation?
I have a set M
consisting of three separate sets of vectors of various size. In other words M = [m_1, m_2, m_3]
where m_i
are vectors of different sizes. For instance m_1
could be 1:10
while m_2 = 22:65
and m_3 = 100:123
(these are separate, no intersection in their elements).
with that, there need to have a variable x[i,j,m]
to have some constraints as the following:
# N is a set which contains all net nodes
# x,z are variables
x[i,j,m] >= z[i,j] for all i,j in N and m in M
Now, we have another variables that are only defined on m_i
like y[i,j,m_1]
. So, at some points in some constraints, there’s only need to put condition over a subset of M
(not all of its components). Similar to the following:
#I'm not writing like julia-- more like math version
sum(x[i,j,m] for i in N) <= y[i, m] for all j in N and m in m_1
I did try to do this by:
@constraint(model, [j in N, m in m_1], sum( x[i,j,m] for i in N) <= y[i, m] )
This is not working though. Do you know how to do this? having a variables that can act both over the whole set M
and also act locally over just m_1
or just m_2
I’m not sure if the issue is variable either. What I need to find out is that how to have flexible variable x
that can handle M
and m_1
at the same time.
Thanks all!