set P:= {1..n}; #set of projects
set RType:={"Project manager", "Technical Expert", "Financial Analyst", "Estimator", "Contractual manager"}; #set of human resources
set T:= {1..l}; #set of terms
set S:= {"SP", "MP", "LP", "XLP"};#set of project sizes : small, medium, large and major
set PS within {P,S}; # Set of project-size combinations
Parameters :
param ES{j in P}; # Earliest starting of the project
param LF{j in P}; # Latest finishing of the project
param Duration{j in P};# duration of project j
param RDemand{s in S, r in RType}; # total number of required resource type r to be allocated to project j on any term within its duration
param Av{r in RType, t in T}>=0; #avaialibility of each human resource type r at the period t
Deicison variables :
var Act{j in P, t in T} binary; #=1 if the project j is executing durint period t and 0 otherwise
var FinMax {j in P} integer;
var Debut{j in P} integer; # starting date of the project j
var Fin{j in P} integer; # Finishing date of the project j
var Y{j in P, r in RType, t in T} integer;# number of human resource type r allocated to project j at period t
subject to DurationConstraint {j in P}:
sum{t in T} Act[j, t] = Duration[j];
subject to AffectConstraint {r in RType, t in T}:
sum {j in P, (j,s) in PS} RDemand[s,r]*Act[j,t]<= Av[r,t];
subject to DemandConstraint {j in P, (j,s) in PS, (j, m) in PM, r in RType,t in T}:
Y[j, r, t] =RDemand[s,m,r]*Act[j,t];
subject to Max_Constraint{j in P, t in T}:
t * Act[j, t] <= FinMax[j];
subject to Define_Fin{j in P}:
Fin[j] = FinMax[j];
subject to ActConstraint {j in P}:
(Fin[j]-Debut[j]) =(sum{t in T} Act[j,t])-1;
subject to FinishConstraint {j in P, t in T: t > LF[j]}:
Act[j,t]=0;
subject to SConstraint {j in P, t in T: t < ES[j]}:
Act[j,t]=0;
Thank you so much!!!
Do not hesitate if you have any question about the problem.
Best regards,
subject to continuityConstraint {j in P, t in T}: t <= Fin[j] - 1 ==> Act[j,t+1] >= Act[j,t];
![]() |
|
|
Available Time for Contact: Saturday - Not available. Sunday - Not available. Monday - 11:00 AM to 12:00 PM and 1:00 PM to 3:00 PM, (UK + Time Zone) Tuesday - 12:00 PM to 2:00 PM, (UK + Time Zone) Wednesday - 12:00 PM to 2:00 PM, (UK + Time Zone) Thursday - 12:00 PM to 2:00 PM, (UK + Time Zone) Friday - 12:00 PM to 2:00 PM, (UK + Time Zone) Contact Number: +4407915302721 Email: ijtih...@gmail.com |
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/f22c6f1a-deda-4210-be6a-daf2961d3ec2n%40googlegroups.com.
(2<= t <= Fin[j]) ==> (Act[j, t] >= Act[j, t-1]);
Error: The redefinition of an indicator constraint "bin_var==0/1 ==> c'x>=d" into a big-M constraint failed due to the absence of a finite lower bound on c'x. If the solver supports indicator constraints, it will be passed to the solver, otherwise this is a fatal error. To remove this error/warning, the following options can be available:
1. Provide tight bounds on variables entering logical expressions;
2. Use option cvt:mip:bigM to set the default value of big-M (use with care);
3. If available, set acc:indle=2 for native handling of the constraint.
exit value 18446744073709551615
subject to continuityConstraint {j in P, t in T: t >= 2}: t <= Fin[j] ==> Act[j,t] >= Act[j,t-1];
Hi,
Thank you so much!
I tried the following constraint :
subject to continuityConstraint {j in P, t in T }:
(2<= t <= Fin[j]) ==> (Act[j, t] >= Act[j, t-1]);
And I got an error message :
Error: The redefinition of an indicator constraint "bin_var==0/1 ==> c'x>=d" into a big-M constraint failed due to the absence of a finite lower bound on c'x. If the solver supports indicator constraints, it will be passed to the solver, otherwise this is a fatal error. To remove this error/warning, the following options can be available:
1. Provide tight bounds on variables entering logical expressions;
2. Use option cvt:mip:bigM to set the default value of big-M (use with care);
3. If available, set acc:indle=2 for native handling of the constraint.
exit value 18446744073709551615
My second question: Is there any way to express this continuity while staying with a linear problem please? We would like to use the Cplex solver and to search for an optimal solution.
Thank you again!
On Fri, Jan 19, 2024 at 6:33 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:Ok let me try
On Fri, Jan 19, 2024 at 4:04 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:What result outcome.
Ijtihad Emon BBA, (Notre Dame University of Bangladesh) MSc.Business
Analytics (University of Kent), UK
+447915302721 | ijtih...@gmail.com
UK, Canterbury
Please make sure to maintain the time available for a contact.
Available Time for Contact:
Saturday - Not available.
Sunday - Not available.
Monday - 11:00 AM to 12:00 PM and 1:00 PM to 3:00 PM, (UK + Time Zone)
Tuesday - 12:00 PM to 2:00 PM, (UK + Time Zone)
Wednesday - 12:00 PM to 2:00 PM, (UK + Time Zone)
Thursday - 12:00 PM to 2:00 PM, (UK + Time Zone)
Friday - 12:00 PM to 2:00 PM, (UK + Time Zone)
Contact Number: +4407915302721
Email: ijtih...@gmail.com
On Thu, 18 Jan 2024 at 9:43 pm, Basma Ben Mahmoud <
On Fri, Jan 19, 2024 at 3:45 AM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Using the current versions of integer programming solvers that work with AMPL, you can write the constraint like this:subject to continuityConstraint {j in P, t in T}: t <= Fin[j] - 1 ==> Act[j,t+1] >= Act[j,t];
(The ==> operator means "implies".) Solvers you can use include Gurobi, Xpress, COPT, MOSEK, HiGHS, SCIP, and CBC.
--
Robert Fourer
We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.