#πŸ”’ The solution in numpy is not working

4 messages Β· Page 1 of 1 (latest)

proper orchid
#

URGENT!

I need to write a programme using numpy, tkinter and random libraries
This programme should solve a three-index transport problem using a genetic algorithm. I will attach the code, screenshots and description of the problem model and genetic algorithm below.

can someone help me with fixing errors in the code and writing 😦

Problem model:
c[ijk] - transportation cost per unit of goods from warehouse i to consumption centre j (shop)
x[ijk] - volume of deliveries of goods of k type, i by the i-th warehouse, to the j-th consumer
a[ij]- quantity of goods supplied by i to consumption centre j
b[jk]- quantity of product k required by consumer j
c[ik]- quantity of product k released from warehouse i
m - number of warehouses, n - number of shops
The objective function is to minimise the transportation cost. That is, the optimal plan is the minimum transport cost.

GA:
Population initialisation.
Assessing the fitness of each individual in the population.
Application of genetic operators such as:
Mutation: making random changes to the genome of an individual.
Crossover: combining parts of the genomes of two individuals to create offspring.
Application of other operators (perhaps selection, inversion, etc.).
Selecting a new population for the next generation.
Checking a stopping condition (e.g., reaching a certain number of generations or a given fitness level).
Return the best individual found as the result.

Code: https://paste.pythondiscord.com/3EUA

fickle prismBOT
#

@proper orchid

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

fickle prismBOT
#

@proper orchid

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.