You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# In the case o fthe Warcraft benchmark, the method has an additional keyword argument to chose the algorithm to use: Dijkstra's algorithm or Bellman-Ford algorithm.
51
51
y =maximizer(θ)
52
52
# As we can see, currently the pipeline predicts random noise as cell weights, and therefore the maximizer returns a straight line path.
53
-
plot_data(b, DataSample(; x, θ, y))
53
+
plot_solution(b, DataSample(; x, θ, y))
54
54
# We can evaluate the current pipeline performance using the optimality gap metric:
Where implemented, benchmarks provide benchmark-specific plotting helpers:
184
-
183
+
Plots is an **optional** dependency, load it with `using Plots` to unlock the plot functions. Not all benchmarks support visualization, call `has_visualization(bench)` to check.
185
184
```julia
186
-
plot_data(bench, sample) # overview of a data sample
187
-
plot_instance(bench, instance) # raw problem instance
188
-
plot_solution(bench, sample, y) # overlay solution on instance
185
+
using Plots
186
+
187
+
bench =Argmax2DBenchmark()
188
+
dataset =generate_dataset(bench, 10)
189
+
sample = dataset[1]
190
+
191
+
has_visualization(bench) # true
192
+
plot_instance(bench, sample) # problem geometry only
193
+
plot_solution(bench, sample) # sample.y overlaid on the instance
194
+
plot_solution(bench, sample, y) # convenience 3-arg form: override y before plotting
195
+
196
+
# Dynamic benchmarks only
197
+
traj =generate_anticipative_solver(bench)(env)
198
+
plot_trajectory(bench, traj) # grid of epoch subplots
199
+
anim =animate_trajectory(bench, traj; fps=2)
200
+
gif(anim, "episode.gif")
189
201
```
202
+
203
+
-`has_visualization(bench)`: returns `true` for benchmarks that implement plot support (if Plots is loaded).
204
+
-`plot_instance(bench, sample; kwargs...)`: renders the problem geometry without any solution.
205
+
-`plot_solution(bench, sample; kwargs...)`: renders `sample.y` overlaid on the instance.
206
+
-`plot_solution(bench, sample, y; kwargs...)`: 3-arg convenience form that overrides `y` before plotting.
207
+
-`plot_trajectory(bench, traj; kwargs...)`: dynamic benchmarks only; produces a grid of per-epoch subplots.
208
+
-`animate_trajectory(bench, traj; kwargs...)`: dynamic benchmarks only, returns a `Plots.Animation` that can be saved with `gif(anim, "file.gif")`.
0 commit comments