SoccerFun-0.4.1: Football simulation framework for teaching functional programming

SoccerFun.MatchControl

Synopsis

Documentation

data Match Source

Constructors

Match 

Fields

team1 :: Team

team1

team2 :: Team

team2

theBall :: BallState

the whereabouts of the ball

theField :: Field

the ball field

theReferee :: Referee

the referee

playingHalf :: Half

first half or second half team1 plays West at first half and East at second half

playingTime :: PlayingTime

todo: add a boolean gameOver, playingtime will not walk back to (zero) and its up to the referee at which time he is to end the game

score :: Score

the score

seed :: StdGen

random seed for generating pseudo random values

unittime :: TimeUnit

the time unit of a single simulation step

Instances

type ScoreSource

Arguments

 = (NrOfGoals, NrOfGoals)

(goals by Team1, goals by Team2)

type NrOfGoalsSource

Arguments

 = Int

(zero) <= nr of goals

alterStamina :: BallState -> Player -> Angle -> Angle -> StaminaSource

Attribute altering functions depending on angles: params: Angle  between (zero) and pi, how much the player is running backwards (pi is backwards). Angle  between (zero) and pi, the difference between the desired angle and the angle the player previously ran to.

type PenaltyFactor = FloatSource

The functions below defines the penalty factor: values between 0.0 and 1.0 that define the loss of an attribute of an action.