In Julia I want to visualise how that function works: eshold stacjaoddania =…
- User
In Julia I want to visualise how that function works: eshold stacja_oddania = argmin(wynik_sim[1]) stacja_odebrania = i wynik_sim[1][i] -= transport_bikes wynik_sim[3][i] += 1 ETA = times + rand(Gamma(czas_dowozu[stacja_odebrania, stacja_oddania][1], 1.2)) new_row = DataFrame(stacja_oddania=stacja_oddania, czas=ETA) for _ in 1:transport_bikes journey = vcat(journey, new_row) end transport = ETA + 20 break end end end end
# Finish journeys for row in eachrow(journey) wynik_sim[1][row.stacja_oddania] += 1 end return wynik_simend
What should I use?
- Assistant
To visualize how the function works in Julia, you can use the Plots package or other plotting libraries such as Gadfly or Makie. The code snippet you provided looks like it's part of a larger function, so it would be helpful to have more context about what you'd like to visualize. However, here is a simple example using the Plots package to visualize the
wynik_simvariable.First, install the Plots package if you haven't already.
using Pkg Pkg.add("Plots")Next, import the package and create a simple function to visualize
wynik_sim. This example assumeswynik_simhas three rows and multiple columns.using Plots function visualize_wynik_sim(wynik_sim) p = plot(wynik_sim[1, :].', title="Wynik Sim", label="Row 1", legend=:topleft) plot!(p, wynik_sim[2, :].', label="Row 2") plot!(p, wynik_sim[3, :].', label="Row 3") display(p) end - User
I wanted to plot the structure of the function.
- Assistant