From 74386a8a566489d47922b07cbbd2958b353bbc43 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson <cont-frb@ulund.org> Date: Sun, 20 Aug 2017 21:16:44 +0200 Subject: [PATCH] Add default sample time BallAndBeam --- src/LabProcesses.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LabProcesses.jl b/src/LabProcesses.jl index 9cfd41e..d067c04 100644 --- a/src/LabProcesses.jl +++ b/src/LabProcesses.jl @@ -37,15 +37,17 @@ finalize(p::AbstractProcess) = error("Function not implemented for $(typeof(p struct BallAndBeam <: PhysicalProcess h::Float64 end +BallAndBeam() = BallAndBeam(0.01) struct BallAndBeamSimulator <: SimulatedProcess h::Float64 end +BallAndBeamSimulator() = BallAndBeamSimulator(0.01) const BallAndBeamType = Union{BallAndBeam, BallAndBeamSimulator} num_outputs(p::BallAndBeamType) = 2 num_inputs(p::BallAndBeamType) = 1 -outputrange(p::BallAndBeamType) = [(-10,10),(-1,1)] # Beam angle, Ball position +outputrange(p::BallAndBeamType) = [(-10,10),(-1,1)] # Beam angle, Ball position inputrange(p::BallAndBeamType) = [(-10,10)] isstable(p::BallAndBeamType) = false sampletime(p::BallAndBeamType) = p.h -- GitLab