Hello everyone,
I created a table in gurobi with a for loop, but that table doesnt look that beautyful with the gurobi status in it.
Thats my run data:
reset;
model 'C:\Users\anwar\Desktop\AMPL\models\datei.mod\datei.mod\A3.mod'
data 'C:\Users\anwar\Desktop\AMPL\models\datei.mod\datei.mod\A3.dat'
option solver gurobi;
# Parameter für Schrittweite und Endkapazität
# Parameter für die Kapazitätserhöhung
param step := 10; # Schrittweise Erhöhung der Kapazität um 10
param C2 := 200;
# Ausgabeheader für die Tabelle
printf "%-12s | %-15s | %-20s\n", "Kapazität", "Lösung existiert", "Zielfunktionswert";
# Schleife zur Kapazitätserhöhung von C bis 2*C
repeat {
solve; # CLSP mit aktueller Kapazität lösen
# Überprüfen, ob eine zulässige Lösung existiert
if solve_result = 'optimal' then {
# Wenn Lösung existiert, formatierten Zielfunktionswert drucken
printf "%-12d | %-15s | %-20.2f\n", C[1], "Ja", costs;
} else {
# Wenn keine Lösung gefunden wurde, drucke Kapazität und "Keine Lösung"
printf "%-12d | %-15s | %-20s\n", C[1], "Nein", "N/A";
}
# Kapazität schrittweise um 'step' erhöhen
let {b in 1..T} C[b] := C[b] + step;
} while C[1] <= 200; # Schleife bis maximaler Kapazität erreicht
display 'C:\Users\anwar\Desktop\AMPL\models\datei.mod\datei.mod\A3.solve'
Is it possible to remove the gurobi status that comes with the solution in the console? For example:
Gurobi 11.0.3: Gurobi 11.0.3: optimal solution; objective 1630
36 simplex iterations
1 branching node
I don’t want these in my table, only the row and column.
Thanks in advance.
Anwar