CellPhysics

floodsim.model.cell.physics.CellPhysics
See theCellPhysics companion object
trait CellPhysics

Represents the physical properties and behaviors of a cell in the simulation. Provides methods to calculate water height, water speed, and water absorption based on cell characteristics.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def calculateAbsorption(incomingWater: Double, currentAbsorption: AbsorptionRate): (Double, AbsorptionRate)

Calculates how much water is absorbed by the cell and updates the absorption rate.

Calculates how much water is absorbed by the cell and updates the absorption rate.

Value parameters

currentAbsorption

the current absorption rate of the cell

incomingWater

the volume of water entering the cell

Attributes

Returns

a tuple containing the amount of water absorbed and the new absorption rate

def calculateWaterHeight(dimensions: Double, waterVolume: Double, obstacles: Seq[Obstacle]): Double

Calculates the height of water in a cell.

Calculates the height of water in a cell.

Value parameters

dimensions

the dimensions of the cell

obstacles

the obstacles present in the cell

waterVolume

the volume of water in the cell

Attributes

Returns

the calculated height of the water

def calculateWaterSpeed(dimensions: Double, waterVolume: Double, obstacles: Seq[Obstacle], absorption: AbsorptionRate): Double

Calculates the speed at which water flows in a cell.

Calculates the speed at which water flows in a cell.

Value parameters

absorption

the absorption rate of the cell

dimensions

the dimensions of the cell

obstacles

the obstacles present in the cell

waterVolume

the volume of water in the cell

Attributes

Returns

the calculated speed of the water