mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-06 23:58:51 -06:00
Add custom show function for Instance and Graph
Without these functions, Julia 1.5 enters an infinite loop whenever it tries to generate a stack trace, so any error (such as a missing method) causes the program to hang, instead of an error message to appear.
This commit is contained in:
@@ -33,3 +33,11 @@ mutable struct Graph
|
||||
collection_shipping_nodes::Vector{ShippingNode}
|
||||
arcs::Vector{Arc}
|
||||
end
|
||||
|
||||
function Base.show(io::IO, instance::Graph)
|
||||
print(io, "RELOG graph with ")
|
||||
print(io, "$(length(instance.process_nodes)) process nodes, ")
|
||||
print(io, "$(length(instance.plant_shipping_nodes)) plant shipping nodes, ")
|
||||
print(io, "$(length(instance.collection_shipping_nodes)) collection shipping nodes, ")
|
||||
print(io, "$(length(instance.arcs)) arcs")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user