MapGenerator

floodsim.model.logic.MapGenerator

Main map generator object that mixes ground and sky generation capabilities.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Show all
Self type

Members list

Value members

Inherited 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

Inherited from:
BaseMapGenerator

Generates a basic ground grid with all cells as fields.

Generates a basic ground grid with all cells as fields.

Value parameters

size

the size of the grid (width and height)

Attributes

Returns

a distance grid containing only field cells

Throws
IllegalArgumentException

if size is not positive

Inherited from:
GroundMapGenerator
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

Inherited from:
BaseMapGenerator

Generates a ground grid with varied cell types. The distribution of cell types is based on distance from a random center point. using Gaussian probability to create natural-looking terrain patterns. Cell types are distributed using Gaussian probability based on distance from center:

Generates a ground grid with varied cell types. The distribution of cell types is based on distance from a random center point. using Gaussian probability to create natural-looking terrain patterns. Cell types are distributed using Gaussian probability based on distance from center:

  • Center: Squares (highest density)
  • Middle ring: Houses with concrete
  • Outer ring: Houses with grass
  • Perimeter: Fields

Value parameters

size

the size of the grid (width and height)

Attributes

Returns

a distance grid with procedurally generated terrain

Throws
IllegalArgumentException

if size is not positive

Inherited from:
GroundMapGenerator
def generateSkyGrid(size: Int, weatherIntensity: Double): Grid[Weather]

Generates a sky grid with varied cell types. The distribution of cell types is based on distance from a random center point. Weather types are distributed in concentric bands around a random center:

Generates a sky grid with varied cell types. The distribution of cell types is based on distance from a random center point. Weather types are distributed in concentric bands around a random center:

  • Center: Heavy rain (expands with higher intensity)
  • Middle: Light rain (contracts with higher intensity)
  • Outer: Heavy clouds
  • Perimeter: Clear sky
  • Default: Intense sun

Value parameters

size

the size of the grid (width and height)

weatherIntensity

the intensity of weather patterns (0.0 to 1.0)

Attributes

Returns

a grid with distributed weather patterns

Throws
IllegalArgumentException

if size is not positive or weatherIntensity is out of bounds

Inherited from:
SkyMapGenerator

Inherited fields

protected val rand: Random

Attributes

Inherited from:
BaseMapGenerator