Skip to main content
Dear all,



In the accompanied model, I try to decrease the inter-facility transport flows between warehouses by changing the production allocation per factory. However, when I try to solve this model, after +- 20 seconds the solution comes back at '0', and I can see that nothing has changed. Could anyone point out to me why this is happening?



Kind regards,
Not sure how to run your model, from what I see after running procedure ReadExcel and MainExecution, parameter TransportCosts and StockCostsPerDay are 0, which leads your objective is 0. Moreover, the index domain of variable TransportRequirements is empty. Variable CustomerPickUpLocation has value so the model is solved. Hope this helps.
Hi Deanne, thank you for your swift reply.



There should be a .data file in the folder as well, which when loaded shows the costs for StockCostsPerDay and TransportCosts. However, even with this data in the model, the solution is still given as 0. I am not really sure what you meant by the second part about a missing index domain, could you explain that to me please? I am struggling to understand.
There are four data files, I used manualdata.data. I do see the parameter has value, but variables TransportRequirements and StockAtWarehouse are 0.



For the empty index domain of TransportRequirements, what I meant was its domain condition:



code:
wf  wt and WareHouseSupply(wf, t) and WareHouseSupply(wt, t) and exists(f|WareHouseFactoryMapping(f, wf)*ProductionCapability(p, f) and WareHouseFactoryMapping(f, wt)*ProductionCapability(p, f))




leads to an empty set, so variable TransportRequirements is never generated, thus it is always 0.
That might be caused by the fact that the variable TransportRequirements is not generated. (You can check this by printing the constraint listing; see the option 'constraint listing'.) This means that the domain condition of this variable is too restrictive:



code:
wf != wt and WareHouseSupply(wf, t) and WareHouseSupply(wt, t) and exists(f|WareHouseFactoryMapping(f, wf)*ProductionCapability(p, f) and WareHouseFactoryMapping(f, wt)*ProductionCapability(p, f))


If you place the last part in a binary parameter, i.e.,



code:
exists(f|WareHouseFactoryMapping(f, wf)*ProductionCapability(p, f) and WareHouseFactoryMapping(f, wt)*ProductionCapability(p, f))


and display its data then you will see that this parameter is only 1 if wf = wt, which contradicts wf != wt.



Note: the community does not support '< >' yet (without a space in between) and therefore I used '!='.
Dear Marcel,



Thank you for your reply. However, I am afraid I am not much wiser. The code you provided in your answer was generated by another AIMMS employee. I have been trying to understand it, but I had never used the exist function before. Could you assist me in understanding what it does and how I could prevent this code from leading to an empty set? In terms of the model, wf is warehousefrom and wt is warehouseto, which both consist of the identical entries from set w (all the warehouses). Since transport costs from wf to wt where wf = wt are 0 anyways, can I just remove the sections that mention this variable altogether?



I am still in the learning shoes of AIMMS and I was hoping to gain more understanding from this project, I hope you are willing to assist me.



Kind regards,



Koen
@KoenV there is an explanation in the Language Reference in section 6.2.5 (Logical iterative expressions) that may offer some help with the ``Exists`` function. (I cannot link it directly, but you can search within the pdf document for
code:
 exists(
and find some other examples there also.)
Hi Jess, thank you for taking the time to answer me. I have seen the link you mentioned, it's just that I don't really understand the terminology and the rest of that code, as someone else from the AIMMS helpdesk had filled it in as a suggestion for a previous problem, so I'm not really sure what the rest of the code does in the first place, let alone how I can fix the problem that Marcel Hunting has mentioned. I hope someone is able to assist me on this, but I will keep reading the language reference document!



Kind regards
Dear all,



I have made some changes to my model. I am not sure whether they are correct or not (see attached link). However, when I try to run it I encounter the error "memory allocation error". I attempted to run the model once more while task manager was open, and I could see that AIMMS took up almost all of the CPU and the memory, therefore resulting in the error.



I am currently running AIMMS on a 64-bit Windows partition on my Macbook, and my current RAM is 8GB. I do have a much faster PC at home (64-bit, 32GB RAM). Would it be possible to solve this model there, if I can somehow install AIMMS on that computer? Or are there errors in my model that make this unsolvable?



https://drive.google.com/open?id=1EvklIDgfqbLBOSelAWRQNMiJDkic8HFM



Kind regards,



Koen
It seems that you basically removed all domain conditions in the model. I think that my colleague added them to reduce the size of the model. Unfortunately (not for him 🙂), he is on vacation.



To solve the model in its current form, AIMMS would need more than 50 Gb memory to solve it. This is mainly caused by the variable CustomerPickUpLocation(c,p,w,t) for which there are 6085 x 521 x 3 x 365 = 3.471.462.075 elements which is a very large number.



Luckily most of these elements don't play a role and therefore they can be excluded. Namely the model contains the constraint CustomerDemandMet with definition



code:
sumsw, CustomerPickUpLocation(c,p, w, t)] = CustomerDemand(c, p, t)


If CustomerDemand(c, p, t) equals 0 then this constraint implies that CustomerPickUpLocation(c,p, w, t) must be 0 for all w (because CustomerPickUpLocation is nonnegative). Therefore we only have to include CustomerPickUpLocation(c,p, w, t) if CustomerDemand(c, p, t) > 0, hence we can use



code:
(c,p,w,t)|CustomerDemand(c, p, t) > 0


for the index domain of CustomerPickUpLocation. The variable CustomerPickUpLocation(c,p,w,t) will not be generated if CustomerDemand(c, p, t) = 0 which saves a lot of memory (and variables that are not generated are set to 0).



You can do something similar for the variable ProductionAllocation(p,f,t).



I have attached a new model file (.ams) with the new domain conditions. I used less domain conditions than my colleague did. You should copy this file to the MainProject folder. To solve this version of the model AIMMS uses around 6 Gb of memory.



However, also in this case the objective value is 0, and all TransportRequirements(p,wf,wt,t) are 0. If this is unexpected then I would recommend you to use a much smaller instance (so less Products, less TimePeriods, etc) to analyze the model.

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator