Cell

floodsim.model.cell.Cell
See theCell companion object
sealed trait Cell extends GridElement

Represents a cell in the simulation grid. A cell is a fundamental unit in the simulation that can contain water, obstacles, and has physical properties that determine how water interacts with it.

Attributes

Companion
object
Graph
Supertypes
trait GridElement
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

The current absorption rate of the cell.

The current absorption rate of the cell.

Attributes

def altitude: Double

The base altitude of the cell.

The base altitude of the cell.

Attributes

The type of this cell.

The type of this cell.

Attributes

def dimensions: Double

The dimensions of the cell (assumes cubic cells).

The dimensions of the cell (assumes cubic cells).

Attributes

def obstacles: Seq[Obstacle]

The obstacles present in this cell.

The obstacles present in this cell.

Attributes

The physics engine used to calculate water behavior in this cell.

The physics engine used to calculate water behavior in this cell.

Attributes

def updateWater(incomingWater: Double): Cell

Updates the water volume in the cell based on incoming water.

Updates the water volume in the cell based on incoming water.

Value parameters

incomingWater

the volume of incoming water to add

Attributes

Returns

a new Cell instance with updated water volume and absorption

def waterVolume: Double

The current volume of water in the cell.

The current volume of water in the cell.

Attributes

Concrete methods

def maxAllowed: Double

Calculates the maximum volume of water the cell can hold considering obstacles.

Calculates the maximum volume of water the cell can hold considering obstacles.

Attributes

def residualCapacity: Double

Calculates how much more water the cell can accept before being full.

Calculates how much more water the cell can accept before being full.

Attributes

Returns

the remaining capacity for water

def totalHeight: Double

Calculates the total height of the cell including altitude and water.

Calculates the total height of the cell including altitude and water.

Attributes

Returns

the combined altitude and water height

def waterHeight: Double

Calculates the current height of water in the cell.

Calculates the current height of water in the cell.

Attributes

Returns

the calculated water height

def waterSpeed: Double

Calculates the current speed of water flow in the cell.

Calculates the current speed of water flow in the cell.

Attributes

Returns

the calculated water speed