#####################################################################
Properties:
#####################################################################

brokerage
expiration
inception
layerId
limit
programId
rate
reinstatements
retention
tax

#####################################################################
Global:
#####################################################################

insert

limits = 1 + reinstatements

#####################################################################
Iteration:
#####################################################################

remainingLimit = limit * limits

remainingRIP = reinstatements * limit * rate

noclaim = 1

#####################################################################
Occurrence:
#####################################################################

a = OccSubject - retention

b = max( a, 0 )

c = min( b, limit )

d = min( c, remainingLimit )

OccLayer = max( d, 0 )

remainingLimit = remainingLimit - OccLayer

noclaim = ( OccLayer > 0 ) ? 0 : noclaim

e = OccLayer * rate

f = min( e, remainingRIP )

OccRIP = max( f, 0 )

remainingRIP = remainingRIP - OccRIP

#####################################################################
Allocation:
#####################################################################

LayerId = layerId

ProgramId = programId

ratio = ( OccSubject > 0 ) ? ( Subject / OccSubject ) : 0

Layer = OccLayer * ratio

RIP = OccRIP * ratio

Brokerage = RIP * brokerage

Tax = RIP * tax
