Skip to content

Commit

Permalink
Merge pull request #5 from EconomicSL/master
Browse files Browse the repository at this point in the history
Update fork
  • Loading branch information
x0range authored Oct 31, 2017
2 parents be1282f + 1452f79 commit fefe70d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions insurancefirm.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,9 @@ def iterate(self, time):
#except:
# print(sys.exc_info())
# pdb.set_trace()
not_accepted_risks += categ_risks[i:]

# reduce not_accepted_risks to insurance risks (properties), since reinsurance risks (contracts) are not returned
not_accepted_risks = [risk for risk in not_accepted_risks if risk.get("contract") is not None]
if self.is_insurer:
not_accepted_risks += categ_risks[i:]
not_accepted_risks = [risk for risk in not_accepted_risks]

#return unacceptables
#print(self.id, " now has ", len(self.underwritten_contracts), " & returns ", len(not_accepted_risks))
Expand Down Expand Up @@ -202,9 +201,9 @@ def ask_reinsurance(self):

nonreinsured.reverse()

if len(nonreinsured) >= (1 - self.reinsurance_limit)*len(self.underwritten_contracts):
if len(nonreinsured) >= (1 - self.reinsurance_limit) * len(self.underwritten_contracts):
counter = 0
limitrein = len(nonreinsured) - (1 - self.reinsurance_limit)*len(self.underwritten_contracts)
limitrein = len(nonreinsured) - (1 - self.reinsurance_limit) * len(self.underwritten_contracts)
for contract in nonreinsured:
if counter < limitrein:
risk = {"value": contract.value, "category": contract.category, "owner": self,
Expand Down

0 comments on commit fefe70d

Please sign in to comment.