Class ReefscapeReefSimulation
java.lang.Object
org.ironmaple.simulation.seasonspecific.reefscape2025.ReefscapeReefSimulation
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCoralsOnReefForDisplay(List<Pose3d> coralPosesToDisplay) Displays all the CORALs scored on the REEF.voidClears all the CORALs scored on the REEF.int[][]Obtains the amount of CORAL held on the BRANCHES.static Optional<ReefscapeReefSimulation>Returns an optional instance.voidsimulationSubTick(int subTickNum)
-
Constructor Details
-
ReefscapeReefSimulation
-
-
Method Details
-
simulationSubTick
public void simulationSubTick(int subTickNum) Description copied from interface:SimulatedArena.Simulatable- Specified by:
simulationSubTickin interfaceSimulatedArena.Simulatable- Parameters:
subTickNum- the number of this sub-tick (counting from 0 in each robot period)
-
addCoralsOnReefForDisplay
Displays all the CORALs scored on the REEF.- Parameters:
coralPosesToDisplay- a list ofPose3dobjects used to visualize the positions of the CORALs on AdvantageScope
-
clearReef
public void clearReef()Clears all the CORALs scored on the REEF. -
getBranches
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 L
j-1branch in theith 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
Returns an optional instance.- Returns:
- (optionally) an instance of this class, empty if
-