Class ReefscapeReefSimulation

java.lang.Object
org.ironmaple.simulation.seasonspecific.reefscape2025.ReefscapeReefSimulation
All Implemented Interfaces:
SimulatedArena.Simulatable

public class ReefscapeReefSimulation extends Object implements SimulatedArena.Simulatable

Simulates the two REEFs on the field.

This class simulates the two REEFs on the field where CORALs can be scored. It includes all 12 ReefscapeReefBranchesTower instances on the field (both blue and red).

  • Constructor Details

  • Method Details

    • simulationSubTick

      public void simulationSubTick(int subTickNum)
      Description copied from interface: SimulatedArena.Simulatable
      Specified by:
      simulationSubTick in interface SimulatedArena.Simulatable
      Parameters:
      subTickNum - the number of this sub-tick (counting from 0 in each robot period)
    • addCoralsOnReefForDisplay

      public void addCoralsOnReefForDisplay(List<Pose3d> coralPosesToDisplay)
      Displays all the CORALs scored on the REEF.
      Parameters:
      coralPosesToDisplay - a list of Pose3d objects used to visualize the positions of the CORALs on AdvantageScope
    • clearReef

      public void clearReef()
      Clears all the CORALs scored on the REEF.
    • getBranches

      public int[][] getBranches(DriverStation.Alliance side)
      Obtains the amount of CORAL held on the BRANCHES.

      This method returns a 2D array of size 12 x 4, where each entry represents the number of CORALs held on a particular branch.

      The BRANCHES are tracked in FMS as A, B, C, D, E, F, G, H, I, J, K, L (as per the game manual), and are mapped to indices 0, 1, 2, ... in the array.

      The [i][j] entry in the array represents the number of CORAL(s) held on the Lj-1 branch in the ith section.

      For example, getBranches()[2][3] returns the number of CORALs held on L4 of Branch C.

      Note that L2, L3, and L4 can only hold one CORAL, while L1 can hold up to two CORALs.

      Parameters:
      side - the alliance side (Red or Blue) to check for CORAL counts
      Returns:
      a 2D array where each entry represents the number of CORAL held on each branch
    • getInstance

      public static Optional<ReefscapeReefSimulation> getInstance()
      Returns an optional instance.
      Returns:
      (optionally) an instance of this class, empty if