-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce common interfaces (abstract supertypes) for similar types #58
Comments
Proposal (I am open for different names): ZeroSet, Singleton <: SingleSet # provide: element(dim), element
HPolygon, HPolygonOpt <: HPolygonal # common: many methods
HPolygonal, VPolygon <: Polygonal # provide: tovrep, tohrep; inherit: dim
SingleSet, BallInf, Hyperrectangle <: Box # provide: radius_b(dim), radius_b
Ball, Box, Zonotope <: PointSymmetric <: LazySet # provide: center; inherit: dim
Ball1, Box, Polygonal, Zonotope <: Polytopic <: LazySet # provide: vertices_list [SingleSet, Ball1, Ball2, Ballp, BallInf <: Ball] -- removed for simplicity
|
Another possible extension is to have implementations for "centered in the origin" sets such as a We do not have to implement such sets right away, but with these changes this will be straight-forward to integrate them later. |
Noooo, Julia does not support multiple supertypes (yet). One can simulate multiple (abstract) supertypes with artificial combination types of course. Maybe I will just do that... 😈 |
Initial motivation: supertype for
HPolygon
andHPolygonOpt
:HPolygon
andHPolygonOpt
.The idea also translates to other types such as
BoxSet
(?) forHyperrectangle
/BallInf
.Another idea is to have different implementations of array-type sets (
MinkowskiSumArray
etc.) that store their dimension for faster access.So the general message here is:
Introduce interface types and usually only work with them.
A crucial implication is that we should never access member/field variables directly (because different implementations may not have those members).
Instead there should be a function that is usually just a getter.
The text was updated successfully, but these errors were encountered: