BaseMapGenerator

floodsim.model.logic.BaseMapGenerator
sealed trait BaseMapGenerator

Base trait providing common functionality for map generation. Contains utility methods for random selection of the center of the generation and Gaussian weight calculations used by both ground and sky map generators.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

protected def gaussianWeight(distance: Double, mean: Double, stdDev: Double): Double

Calculates Gaussian weight for distance-based probability calculations.

Calculates Gaussian weight for distance-based probability calculations.

Value parameters

distance

the distance from center

mean

the mean of the Gaussian distribution

stdDev

the standard deviation of the Gaussian distribution

Attributes

Returns

the Gaussian weight value

protected def generateDistributedGrid[T](size: Int, selector: (Double, Double) => T): Map[Coordinate, T]

Common grid generation method that builds a grid based on a selection function generalizing the element type for any possible grid generation.

Common grid generation method that builds a grid based on a selection function generalizing the element type for any possible grid generation.

Type parameters

T

the type of elements in the grid

Value parameters

selector

a function that selects an element based on normalized distance and random value

size

the size of the grid (width and height)

Attributes

Returns

a map of coordinates to elements

Concrete fields

protected val rand: Random