Class FuzzyBoundary2D

java.lang.Object
org.episteme.core.mathematics.geometry.boundaries.FuzzyBoundary2D
All Implemented Interfaces:
Serializable, Boundary<Point2D>, Boundary2D

public class FuzzyBoundary2D extends Object implements Boundary2D
A 2D boundary with fuzzy (graded) membership.

Unlike crisp boundaries where a point is either IN (1.0) or OUT (0.0), fuzzy boundaries return a membership degree in the range [0, 1].

This is useful for:

  • Uncertainty in boundary definition
  • Transition zones (e.g., ecological gradients)
  • Influence zones (diminishing influence with distance)
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • FuzzyBoundary2D

      public FuzzyBoundary2D(Boundary2D core, Boundary2D support)
      Creates a fuzzy boundary from core and support boundaries. Points in core have membership 1.0, points outside support have 0.0, and points between have graded membership.
      Parameters:
      core - the core boundary (full membership)
      support - the support boundary (membership > 0)
    • FuzzyBoundary2D

      public FuzzyBoundary2D(Boundary2D core, Boundary2D support, Function<Real,Real> membershipFunction)
      Creates a fuzzy boundary with custom membership function.
      Parameters:
      core - the core boundary
      support - the support boundary
      membershipFunction - maps distance ratio to membership [0,1]
  • Method Details

    • withBuffer

      public static FuzzyBoundary2D withBuffer(Boundary2D crisp, Real bufferWidth)
      Creates a fuzzy boundary with a buffer zone around a crisp boundary.
      Parameters:
      crisp - the crisp boundary
      bufferWidth - the width of the transition zone
      Returns:
      fuzzy boundary
    • getMembership

      public Real getMembership(Point2D point)
      Returns the membership degree for a point.
      Parameters:
      point - the point to test
      Returns:
      membership in [0, 1]: 1.0 = definitely inside, 0.0 = definitely outside
    • linearMembership

      public static Real linearMembership(Real ratio)
      Linear membership function: f(r) = r
    • sigmoidMembership

      public static Real sigmoidMembership(Real ratio)
      Sigmoid membership function for smooth transition.
    • gaussianMembership

      public static Real gaussianMembership(Real ratio)
      Gaussian membership function.
    • fuzzyAnd

      public Real fuzzyAnd(Point2D point, FuzzyBoundary2D other)
      Fuzzy AND (intersection) - minimum membership.
    • fuzzyOr

      public Real fuzzyOr(Point2D point, FuzzyBoundary2D other)
      Fuzzy OR (union) - maximum membership.
    • fuzzyNot

      public Real fuzzyNot(Point2D point)
      Fuzzy NOT - complement membership.
    • alphaCut

      public Boundary2D alphaCut(Real alpha)
      Returns a crisp boundary for a given alpha level. Points with membership >= alpha are included.
      Parameters:
      alpha - the threshold (0 to 1)
      Returns:
      the alpha-cut boundary
    • contains

      public boolean contains(Point2D point)
      Description copied from interface: Boundary
      Checks if a point is contained within this boundary.
      Specified by:
      contains in interface Boundary<Point2D>
      Parameters:
      point - the point to test
      Returns:
      true if point is inside or on the boundary
    • getVertices

      public List<Point2D> getVertices()
      Description copied from interface: Boundary2D
      Returns the vertices of this boundary in order.
      Specified by:
      getVertices in interface Boundary2D
      Returns:
      list of vertices
    • getVertexCount

      public int getVertexCount()
      Description copied from interface: Boundary2D
      Returns the number of vertices.
      Specified by:
      getVertexCount in interface Boundary2D
      Returns:
      vertex count
    • getVertex

      public Point2D getVertex(int index)
      Description copied from interface: Boundary2D
      Returns a specific vertex.
      Specified by:
      getVertex in interface Boundary2D
      Parameters:
      index - the vertex index
      Returns:
      the vertex
    • getArea

      public Real getArea()
      Description copied from interface: Boundary2D
      Returns the area of this 2D boundary.
      Specified by:
      getArea in interface Boundary2D
      Returns:
      the area
    • getPerimeter

      public Real getPerimeter()
      Description copied from interface: Boundary2D
      Returns the perimeter of this 2D boundary.
      Specified by:
      getPerimeter in interface Boundary2D
      Returns:
      the perimeter
    • isConvex

      public boolean isConvex()
      Description copied from interface: Boundary2D
      Checks if this boundary is convex.
      Specified by:
      isConvex in interface Boundary2D
      Returns:
      true if convex
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Boundary
      Checks if this boundary is empty.
      Specified by:
      isEmpty in interface Boundary<Point2D>
      Returns:
      true if the boundary has no extent
    • getCentroid

      public Point2D getCentroid()
      Description copied from interface: Boundary
      Returns the centroid of this boundary.
      Specified by:
      getCentroid in interface Boundary<Point2D>
      Returns:
      the geometric center
    • getBoundingBox

      public BoundingBox<Point2D> getBoundingBox()
      Description copied from interface: Boundary
      Returns the bounding box of this boundary.
      Specified by:
      getBoundingBox in interface Boundary<Point2D>
      Returns:
      an axis-aligned bounding box
    • intersects

      public boolean intersects(Boundary<Point2D> other)
      Description copied from interface: Boundary
      Checks if this boundary intersects with another.
      Specified by:
      intersects in interface Boundary<Point2D>
      Parameters:
      other - the other boundary
      Returns:
      true if boundaries intersect
    • union

      public Boundary<Point2D> union(Boundary<Point2D> other)
      Description copied from interface: Boundary
      Computes the union of this boundary with another.
      Specified by:
      union in interface Boundary<Point2D>
      Parameters:
      other - the other boundary
      Returns:
      the union boundary
    • intersection

      public Boundary<Point2D> intersection(Boundary<Point2D> other)
      Description copied from interface: Boundary
      Computes the intersection of this boundary with another.
      Specified by:
      intersection in interface Boundary<Point2D>
      Parameters:
      other - the other boundary
      Returns:
      the intersection boundary
    • convexHull

      public Boundary<Point2D> convexHull()
      Description copied from interface: Boundary
      Computes the convex hull of this boundary.
      Specified by:
      convexHull in interface Boundary<Point2D>
      Returns:
      the convex hull
    • translate

      public Boundary<Point2D> translate(Point2D offset)
      Description copied from interface: Boundary
      Creates a copy of this boundary translated by a vector.
      Specified by:
      translate in interface Boundary<Point2D>
      Parameters:
      offset - the translation vector (as point)
      Returns:
      translated boundary
    • scale

      public Boundary<Point2D> scale(Real factor)
      Description copied from interface: Boundary
      Creates a scaled copy of this boundary.
      Specified by:
      scale in interface Boundary<Point2D>
      Parameters:
      factor - the scaling factor
      Returns:
      scaled boundary
    • rotate

      public Boundary2D rotate(Real angleRadians)
      Description copied from interface: Boundary2D
      Rotates the boundary around the centroid.
      Specified by:
      rotate in interface Boundary2D
      Parameters:
      angleRadians - rotation angle in radians
      Returns:
      rotated boundary
    • rotateAround

      public Boundary2D rotateAround(Real angleRadians, Point2D pivot)
      Description copied from interface: Boundary2D
      Rotates around a specific pivot point.
      Specified by:
      rotateAround in interface Boundary2D
      Parameters:
      angleRadians - rotation angle
      pivot - the pivot point
      Returns:
      rotated boundary
    • extrude

      public Boundary3D extrude(Real height)
      Description copied from interface: Boundary2D
      Creates an extruded 3D boundary from this 2D boundary.
      Specified by:
      extrude in interface Boundary2D
      Parameters:
      height - the extrusion height
      Returns:
      a 3D boundary
    • getCore

      public Boundary2D getCore()
      Returns the core boundary.
      Returns:
      the core
    • getSupport

      public Boundary2D getSupport()
      Returns the support boundary.
      Returns:
      the support
    • toString

      public String toString()
      Overrides:
      toString in class Object