Removing the gurobi status from Tables

34 views
Skip to first unread message

Anwar Muheidat

unread,
Nov 25, 2024, 11:10:57 AM11/25/24
to AMPL Modeling Language
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 dont want these in ym table, only the row and colum.

Thanks in advance.

Anwar

AMPL Google Group

unread,
Feb 16, 2025, 11:01:57 PMFeb 16
to AMPL Modeling Language
Your question has been moved to our new user forum at discuss.ampl.com, and a response has been posted there. To see the response, use this link:

https://discuss.ampl.com/t/ampl-25070-removing-the-gurobi-status-from-tables/1992/2

To reply, click the red "Reply" button that follows the response. (Do not send an email reply to this message.)


--
Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
{#HS:2773381441-130661#}
Reply all
Reply to author
Forward
0 new messages