Open BrettKnoss opened 3 years ago
HiGHS is available at https://www.maths.ed.ac.uk/hall/HiGHS/
However, the current version dropped compatibility with HiGHS by implementing the model in Pyomo. Hence, you can use any solver available in the Pyomo (as long as you have it installed and configured properly). If you are aiming for open-source try using GLPK. Tho, performance will be much better with CPLEX or Gurobi. More info in https://pyomo.readthedocs.io/en/stable/working_models.html
I will update the README to remove the session on HiGHS.
OK, the notes suggest that that to change line 7, and I saw ant is a note. Do I change line 8 run? Or is there anything I need to change now?
I downloaded and extracted GLPK. I'm not sure from the documentation how to set it up.
You just need to change line 86 on the config.py file. Instead of cplex, put the name of the solver accordingly to the Pyomo documentation. I think it is 'glpk'. You need to make sure that pyomo can find glpk or whatever solver you are using. You can check that by running:
import pyomo.environ as pyo
print(pyo.SolverFactory('glpk').available())
print(pyo.SolverFactory('cplex_direct').available())
If you check Pyomo documentation or stackoverflow, you will find indications of troubleshooting and installation.
IMPORTANT: if you are using 'cplex' in MacOS, you need to change it (config.py line 86) to 'cplex_direct'. I don't know why this happens. It is some bug with Pyomo.
I'm not sure I have the latest version. The last row of config.py is
SOLVER = 'Highs'
Sent from ProtonMail mobile
-------- Original Message -------- On Aug. 6, 2021, 10:54 a.m., BlackNellore wrote:
You just need to change line 86 on the config.py file. Instead of cplex, put the name of the solver accordingly to the Pyomo documentation. I think it is 'glpk'. You need to make cure that pyomo can find glpk or whatever solver you are using. You can check that by running:
import pyomo.environ as pyo
print(pyo.SolverFactory('glpk').available()) print(pyo.SolverFactory('cplex_direct').available())
IMPORTANT: if you are using 'cplex' in MacOS, you need to change it (config.py line 86) to 'cplex_direct'. I don't know why this happens. It is some bug with Pyomo.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I was confusing MaxProfitDiet with MaxProfitFeeding. Is the only difference that Diet is newer?
Sent from ProtonMail mobile
-------- Original Message -------- On Aug. 6, 2021, 10:54 a.m., BlackNellore wrote:
You just need to change line 86 on the config.py file. Instead of cplex, put the name of the solver accordingly to the Pyomo documentation. I think it is 'glpk'. You need to make cure that pyomo can find glpk or whatever solver you are using. You can check that by running:
import pyomo.environ as pyo
print(pyo.SolverFactory('glpk').available()) print(pyo.SolverFactory('cplex_direct').available())
IMPORTANT: if you are using 'cplex' in MacOS, you need to change it (config.py line 86) to 'cplex_direct'. I don't know why this happens. It is some bug with Pyomo.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Yes, I figured this would happen. My projects are related with peer-reviewed publications (some still under the review process). Hence, I avoid mixing the codes and I keep the version utilized in each paper for reference. In short: (1) MaxProfitFeeding is a profit-maximizing diet model. It was finished and published. If your goal is to run such diets, this may work fine. (2) EMB_MaxProfitDiet is an upgrade of (1) with some extended capabilities. It can run batchs by parsing a csv with data and the column name. This only works in specific fields. What's more, it can calculate the nonlinear "reduced cost" - lagrange multipliers - of an particular ingredient of interest. This is a paper under review that estimates the opportunity costs of certain ingredients. (3) Greenfeeding is a multi-objective balancing maximum profit (1) and minimization of environmental impacts based on the work of Garcia-Launay et al. 2018. This paper is also under review.
Depending on your goals, you may prefer using one or the other. (2) and (3) have pretty much the same functionalities, I just keep them separate because I am collaborating with different people in these projects. A great divisor between (1) and the others is the usage of the Ruminant Nutrition System to compute animal requirements and ingredients' properties.
I am gonna update the README of the EMB_MaxProfitDiet. If you feel like it, reach me via the e-mail available in the paper referenced in (1), if you explain to me what you trying to do, I think I can give you better directions.
Do you have a way to message you?
What does environmental impact mean? I do know of farmers that use the cost of macronutrient fertilizers in determining the cost of straw, less so with hay, and I'm not sure that can be done with grazing. At this time I'm only concerned with diet, but it is something to keep in mind.
Do you have a way to message you?
Check my e-mail in the paper I mentioned, here: https://doi.org/10.1017/S1751731120001433 I am the first author.
What does environmental impact mean? I do know of farmers that use the cost of macronutrient fertilizers in determining the cost of straw, less so with hay, and I'm not sure that can be done with grazing. At this time I'm only concerned with diet, but it is something to keep in mind.
Read Garcia-Launay et al. 2018: https://doi.org/10.1017/S0007114518002672
Are you J.G.O. Marquis ?
Where do I find HiGHS.so in order to use this on a BigSur machine.