Closed vsinha027 closed 1 year ago
constraint_7 = all( np.isclose( self.flow_sites_to_depots[:, depot].sum(), self.flow_depots_to_refineries[depot, :].sum(), atol=1e-03 ) for depot in range(self.num_depots) )
This code should fix it. We iterate over each depot and checks if the total flow of biomass from all sites to that depot is equal to the total flow of pellets from that depot to all refineries.
This is still incorrect since we iterate over num_depots and not the locations where depots/biorefineries were placed. I have a feeling that this goes wrong in other parts of the code as well, check the two flow csv files in 0fac555. You can see that the flows only go to 0 to 19. Which means that if you have 20 depots they will always be at index 0 to 19.
After a call, we figured out that actually it was correct :-) The reason why it's correct is because, we never need to know the latitude longitude coordinate of the centers since we do not change them. Nevertheless, it implies that we make the adjustments in the Final matrix.
https://github.com/akalikadien/shell-ai-hackaton-2023/blob/96f4d4721210dd5bfbfc90faf08dc17a9c5ca04f/place_storage_and_refineries_optimize_flow.py#L57
We need to check the flow per depot to the refinery/refineries that it sends pellets to.