Skip to content

Commit d3390de

Browse files
committedNov 10, 2017
Prepared riskmodel for non-proportional reinsurance (first part)
1 parent 13dd6c9 commit d3390de

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎insurancefirm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def iterate(self, time): # TODO: split function so that only the sequence
7878
print("Something wrong; agent {0:d} receives too few new contracts {1:d} <= {2:d}".format(self.id, contracts_offered, 2*contracts_dissolved))
7979
#print(self.id, " has ", len(self.underwritten_contracts), " & receives ", contracts_offered, " & lost ", contracts_dissolved)
8080

81-
new_nonproportional_risks = [risk for risk in new_risks if risk.get("insurancetype")=='non-proportional']
81+
new_nonproportional_risks = [risk for risk in new_risks if risk.get("insurancetype")=='excess-of-loss']
8282
new_risks = [risk for risk in new_risks if risk.get("insurancetype") in ['proportional', None]]
8383

8484
underwritten_risks = [{"excess": contract.value, "category": contract.category, \
@@ -215,7 +215,7 @@ def ask_reinsurance_non_proportional(self):
215215
avg_risk_factor /= number_risks
216216
risk = {"value": total_value, "category": categ_id, "owner": self,
217217
#"identifier": uuid.uuid1(),
218-
"insurancetype": 'non-proportional',"number_risks": number_risks,
218+
"insurancetype": 'excess-of-loss', "number_risks": number_risks,
219219
"deductible": self.np_reinsurance_deductible, "excess": np_reinsurance_excess,
220220
"periodized_total_premium": periodized_total_premium, "runtime": 12,
221221
"expiration": time + 12, "risk_factor": avg_risk_factor}

‎riskmodel.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ def compute_expectation(self, categ_risks, categ_id): #TODO: more intuitive
7575

7676
return average_risk_factor, average_exposure, incr_expected_profits
7777

78-
def evaluate(self, risks, cash):
78+
def evaluate(self, risks, cash, offered_risk = None):
79+
# sort current contracts
80+
el_risks = [risk for risk in risks if risk["insurancetype"] == 'excess-of-loss']
81+
risks = [risk for risk in risks if risk["insurancetype"] == 'proportional']
82+
7983
acceptable_by_category = []
8084
remaining_acceptable_by_category = []
8185
expected_profits = 0

0 commit comments

Comments
 (0)
Please sign in to comment.