I have been following the Employee Training example. However, I cannot run the code (attached). It is said that the solution does not exist. I don’t know what causes it.
Furthermore, how do I check and know if the equations are not feasible ya? I’ve been looking into this Math Inspector, but somehow it’s difficult to understand for me.
Best answer by Marcel HuntingView original
I think the reason is i do not specify in Dec there are 60 flight attendants and in Nov there are 2 trainees joining. How do I specify this in the variable ya? In the example, I don’t see anything different in the attribute of the variables, but when looking at the data of the variable, the month of Dec is there while the other months are not there. In what I do (attached above), i don’t see this month of Dec while i see the entire months from Jan to June. Could you please help on this?
@zulfan.adiputra , the model is indeed infeasible, that is, no feasible solution exists. You can find out why by selecting the action Irreducible Infeasible Set (IIS) in the Math Program Inspector, if you use a newer AIMMS version (4.73 or newer) because older AIMMS versions have some limitations on determining the IIS.
After selecting this action, AIMMS will point to the constraints Attendants_definition(January) and Attendants_definition(February). For January the constraint becomes
and for February
(You can check this by selecting the action Create Constraint Listing in the Math Program Inspector.) Hence, Attendants(February) should be equal to -2 which is not possible because Attendants is nonnegative.
@Marcel Hunting . Thanks for this. Could you please help on showing how to add the initial number of attendants (60 in Dec) and trainees (2 in Nov) as I mentioned in my own reply?
You can add two new parameters:
And then (probably) you want to add
to the definition of Attendants.
Note that StartPeriod has the value ‘January’ in the case file that you are loading. This means that the planning interval of the horizon TimePeriod will start at January instead of November, and therefore, e.g., Attendants(November) does not exist. You might want to add
before the solve statement.
Thanks a lot for this.
I am curious about how the original example (attached) can add this Dec and Nov data without introducing these two additional parameters like you said.
@zulfan.adiputra , looking closer it seems related to the initial data for Attendants and TraineesHired. In the original project the data of these variables is read from a text file, that is, after reading the text file Attendants('December') equals 60 and TraineesHired('November') equals 2. Somehow the data of these two identfiers is not stored in the case file that you are loading in your newer version of the project. You can resolve this by adding
before the solve statement. With this change it is no longer needed to add the parameters InitialAttendants and InitialTrainees, or to change the StartPeriod.
Thanks a lot for this workaround. I never thought that it would be this straightforward. Thanks, I’ll explore more examples to get myself familiar with AIMMS.