Need Assistance with Time-Dependent Constraints in AMPL


I am currently working on a production scheduling problem using AMPL and have faced some challenges with incorporating time-dependent constraints into my model. I am struggling to efficiently model constraints that vary dynamically based on factors such as production schedules, resource availability, and demand fluctuations over time.

I want to optimize production schedules while considering fluctuating demand forecasts and resource constraints over time.
Incorporating time-dependent constraints into the model to ensure production quantities align with demand forecasts and resource availability dynamically.

Below is simplified version of my current attempt in AMPL:

set Time;
param demand_forecast{Time};
param resource_availability{Time};
var production{Time} >= 0;
var inventory{Time} >= 0;

Objective function
minimize TotalCost:
sum{t in Time} production[t];

subject to meet_demand {
forall(t in Time) {
production[t] <= demand_forecast[t] + inventory[t-1] - inventory[t] + resource_availability[t];

Additional constraints and model details go here

I need guidance on how to effectively model these time-dependent constraints and optimize the production scheduling problem in AMPL. I have checked native guide but still need help.

Any advice from the community would be greatly appreciated.

Thank you in advance for your assistance!

Thank you :slightly_smiling_face: