MartingaleStrat

model.entities.customers.MartingaleStrat
See theMartingaleStrat companion object
case class MartingaleStrat[A <: Bankroll[A] & CustomerState[A]](baseBet: Double, betAmount: Double, lossStreak: Int, option: List[Int]) extends BettingStrategy[A]

Implements the Martingale betting strategy. The bet amount doubles after each loss and resets to base after a win.

Type parameters

A

The entity type using this strategy.

Value parameters

baseBet

The initial bet amount to which the strategy resets after a win.

betAmount

The current bet amount for the next round.

lossStreak

The current number of consecutive losses.

option

Game-specific options for the bet.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait BettingStrategy[A]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def betType: BetStratType

Returns the type of this betting strategy.

Returns the type of this betting strategy.

Attributes

Returns

The BetStratType for this strategy.

Definition Classes
def nextBet(): Double

Calculates the next bet amount based on the current loss streak for Martingale.

Calculates the next bet amount based on the current loss streak for Martingale.

Attributes

Returns

The next bet amount.

override def placeBet(ctx: A): Bet

Generates a game-specific bet for Martingale strategy. Currently supports Roulette and Blackjack.

Generates a game-specific bet for Martingale strategy. Currently supports Roulette and Blackjack.

Value parameters

ctx

The customer entity's context.

Attributes

Returns

A Bet object.

Throws
MatchError

if the customer state is not Playing or game type is unsupported.

Definition Classes
override def updateAfter(ctx: A, result: Double): MartingaleStrat[A]

Updates the Martingale strategy's state based on the game result. If result is negative (loss), bet doubles and loss streak increments. If result is positive (win), bet resets to base and loss streak resets. If result is zero (push), state remains unchanged.

Updates the Martingale strategy's state based on the game result. If result is negative (loss), bet doubles and loss streak increments. If result is positive (win), bet resets to base and loss streak resets. If result is zero (push), state remains unchanged.

Value parameters

ctx

The customer entity's context.

result

The outcome of the game round.

Attributes

Returns

A new MartingaleStrat instance with updated state.

Definition Classes

Inherited methods

protected def checkRequirement(ctx: A): Unit

Checks preconditions before placing a bet. Throws a require error if the bet amount exceeds bankroll or if the customer is not in a Playing state.

Checks preconditions before placing a bet. Throws a require error if the bet amount exceeds bankroll or if the customer is not in a Playing state.

Value parameters

ctx

The customer entity's context.

Attributes

Inherited from:
BettingStrategy
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product