예제 #1
0
파일: awi.py 프로젝트: ayansengupta17/scml
    def buyInsurance(self, contract: Dict[str, Any]) -> bool:
        """Buys insurance for the contract by the premium calculated by the insurance company.

        Remarks:
            The agent can call `evaluate_insurance` to find the premium that will be used.
        """
        return self.shadow.buy_insurance(from_java(contract))
예제 #2
0
 def requestNegotiation(self,
                        cfp,
                        req_id: str,
                        roles=None,
                        mechanism_name=None,
                        mechanism_params=None):
     return self.shadow.request_negotiation(from_java(cfp), req_id, roles,
                                            mechanism_name,
                                            mechanism_params)
예제 #3
0
파일: awi.py 프로젝트: ayansengupta17/scml
    def evaluateInsurance(
        self, contract: Dict[str, Any], t: int = None
    ) -> Optional[float]:
        """Can be called to evaluate the premium for insuring the given contract against breaches committed by others

        Args:

            contract: hypothetical contract
            t: time at which the policy is to be bought. If None, it means current step
        """
        result = self.shadow.evaluate_insurance(from_java(contract), t)
        if result < 0:
            return None
        return result
예제 #4
0
파일: awi.py 프로젝트: ayansengupta17/scml
 def unregisterInterest(self, products: List[int]) -> None:
     """registers interest in receiving callbacks about CFPs related to these products"""
     self.shadow.unregister_interest(from_java(products))
예제 #5
0
파일: awi.py 프로젝트: ayansengupta17/scml
 def removeCFP(self, cfp: Dict[str, Any]) -> bool:
     """Removes a CFP"""
     return self.shadow.remove_cfp(from_java(cfp))
예제 #6
0
파일: awi.py 프로젝트: ayansengupta17/scml
 def registerCFP(self, cfp: Dict[str, Any]) -> None:
     """Registers a CFP"""
     self.shadow.register_cfp(from_java(cfp))