Skip to main content
Solved

How to build a crossroad/ 2 ways

  • March 15, 2021
  • 9 replies
  • 90 views

Tom Rolf
Forum|alt.badge.img

Hi,

I want to build a model that can transport stuff from (i to j) directly or by stopping over at facility r.

The transportcost (i to r) and (r to j) are cheaper than the direct transport (i to j).

 

Problems:

Open(r ) is either 0 or all possible r are opened and the amount is divided up evenly

Even if transportcosts are way lower for the extrastop r than without, the model does never choose to move all products past extrastop r. (capacities are more than enough)

 

 

(goal is to minimize total cost (fixed cost and transport cost included)

Related Constraints:

  1. Amount(i,r)+Amount(d,r)<=Demand(i)*OpenRecycling( r) // index (i,d,r)
  2. sum(i,Amount(i,r))+sum(d,Amount(d,r))<=Capacity(r)* Open( r)   //index (r )
  3. sum(r,Amount(i,r))+sum(r,Amount(d,r))=(Returnrate(i)*(demand(i))) //index (i,r)
  4. sum(i,Amount(i,d))<=Capacity(d)*open(d)      //index(d)
  5. sum(i,Amount(i,d))=sum(r,Amount(d,r))         //index(d)

 

 

Thanks for your help.

I´m more than happy to post my model if that helps

Best answer by Marcel Hunting

Thanks. I was now able to load the data and run the model.

I am not sure whether I understand your issue completely. The model generates the constraint

NB3(1,1,1):

RueckgesendeteMengevonCustomeranRecycling(1,1) + MengevonContaineranRecycling(1,1) <= 10 * OpenRecycling(1)

In the solution OpenRecycling(1) equals 1, RueckgesendeteMengevonCustomeranRecycling(1,1) equals 0 and MengevonContaineranRecycling(1,1) equals 9.

If your question is why the sum of RueckgesendeteMengevonCustomeranRecycling(1,1) and MengevonContaineranRecycling(1,1) is not equal to 10 then the answer is given by constraint

NB8(1,1):

RueckgesendeteMengevonCustomeranRecycling(1,1) + RueckgesendeteMengevonCustomeranRecycling(1,2) +
RueckgesendeteMengevonCustomeranRecycling(1,3) + RueckgesendeteMengevonCustomeranRecycling(1,4) +
MengevonContaineranRecycling(1,1) + MengevonContaineranRecycling(1,2) + MengevonContaineranRecycling(1,3) + MengevonContaineranRecycling(1,4) = 9

This constraint enforces that the sum of RueckgesendeteMengevonCustomeranRecycling(1,1) and MengevonContaineranRecycling(1,1) can never exceed 9.

You might want to print the constraint listing to inspect the constraints as AIMMS actually generates them. You can do so by setting the following options:

  • Solvers General option 'Constraint Listing' to 'At every solve' (or 'At first solve');
  • Solvers General option 'Constraint Listing Variable Values' to 'Print variable values';

The constraint listing will be printed in the file ‘Masterarbeit.lis’ in the log folder.

9 replies

  • 0 replies
  • March 15, 2021

Hi @Tom Rolf ,

Please do post your model so community users can build on what you already created. You can do this by zipping the project folder and assign it here.


Tom Rolf
Forum|alt.badge.img
  • Author
  • Explorer
  • 4 replies
  • March 15, 2021

ModellForum.zip should be the working

 


Marcel Hunting
AIMMSian
Forum|alt.badge.img+4
  • AIMMSian
  • 258 replies
  • March 17, 2021

Hi @Tom Rolf . The zip file only contains an .ams file which is not sufficient because it does not contain any data. Please add the complete AIMMS project folder to a zip file. If the model contains sensitive data then you can also send it to our support (with a reference to this topic).


Tom Rolf
Forum|alt.badge.img
  • Author
  • Explorer
  • 4 replies
  • March 17, 2021

Hi Marcel,

Thanks for the advice. This is the whole thing in .zip  


Marcel Hunting
AIMMSian
Forum|alt.badge.img+4
  • AIMMSian
  • 258 replies
  • March 17, 2021

Hi @Tom Rolf. I still don’t see any data. How do you load the data in this project?

 

Please note that your zip file does not include the complete AIMMS project folder; that would be the folder with the .aimms file plus all subfolders (like MainProject).


Tom Rolf
Forum|alt.badge.img
  • Author
  • Explorer
  • 4 replies
  • March 17, 2021

Sorry, I never had to send a model. thats how I save the actual data.

Can you open the model ?

 

 


Marcel Hunting
AIMMSian
Forum|alt.badge.img+4
  • AIMMSian
  • 258 replies
  • Answer
  • March 17, 2021

Thanks. I was now able to load the data and run the model.

I am not sure whether I understand your issue completely. The model generates the constraint

NB3(1,1,1):

RueckgesendeteMengevonCustomeranRecycling(1,1) + MengevonContaineranRecycling(1,1) <= 10 * OpenRecycling(1)

In the solution OpenRecycling(1) equals 1, RueckgesendeteMengevonCustomeranRecycling(1,1) equals 0 and MengevonContaineranRecycling(1,1) equals 9.

If your question is why the sum of RueckgesendeteMengevonCustomeranRecycling(1,1) and MengevonContaineranRecycling(1,1) is not equal to 10 then the answer is given by constraint

NB8(1,1):

RueckgesendeteMengevonCustomeranRecycling(1,1) + RueckgesendeteMengevonCustomeranRecycling(1,2) +
RueckgesendeteMengevonCustomeranRecycling(1,3) + RueckgesendeteMengevonCustomeranRecycling(1,4) +
MengevonContaineranRecycling(1,1) + MengevonContaineranRecycling(1,2) + MengevonContaineranRecycling(1,3) + MengevonContaineranRecycling(1,4) = 9

This constraint enforces that the sum of RueckgesendeteMengevonCustomeranRecycling(1,1) and MengevonContaineranRecycling(1,1) can never exceed 9.

You might want to print the constraint listing to inspect the constraints as AIMMS actually generates them. You can do so by setting the following options:

  • Solvers General option 'Constraint Listing' to 'At every solve' (or 'At first solve');
  • Solvers General option 'Constraint Listing Variable Values' to 'Print variable values';

The constraint listing will be printed in the file ‘Masterarbeit.lis’ in the log folder.


Tom Rolf
Forum|alt.badge.img
  • Author
  • Explorer
  • 4 replies
  • March 17, 2021

Hey Marcel,

Thank you so much, the print version makes it so much easier as well.

 

You were right, constraint NB8 blocked the model.

My intention with NB8 was to make sure; the amount customers send to recycling (direct or via ´container´) does not exceed the produced amount* returnrate(0-0.9).

 

Without NB8 the model works really good, except recycling/disposal more than produced.

And it keeps opening all facilities (j) even if not used

 

Really appreciate the help, before It got a bit frustrating

 


mohansx
Forum|alt.badge.img+5
  • Former AIMMSian
  • 223 replies
  • March 18, 2021

@Tom Rolf You might want to take a look at this resource on how to share an AIMMS project. 

Share an AIMMS Project — AIMMS How-To



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

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