Beispiel #1
0
    def __init__(self, amount, interest, date=None, name=None, meta={}):

        self._date_start = validate.valid_date(date)
        self._name = validate.valid_name(name)
        self._meta = meta

        # check for problems
        assert ((isinstance(amount, int) or (isinstance(amount, float))))
        if interest > 1.:
            interest = interest / 100.

        ## generic variables, which are basically used in any class ##
        ## that inherits from account                               ##

        # setting up the report and the semantics
        self._report = Report(name=self._name)

        self._account = int(amount * 100)  # amount of money to start with
        self._interest = interest  # interest rate

        self._current_date = self._date_start  # current date of the simulation
        self._caccount = self._account  # current account, this variable
        # is used in all subclasses

        # sum helper variables for interest calculation and keep
        self._sum_interest = 0
Beispiel #2
0
    def __init__(self,
                 property_value,
                 amount,
                 loan,
                 date=None,
                 name=None,
                 meta={}):
        """
        For a property with a given value (property_value), the current amount
        that is transfered to the owner (amount) is reflected by the amount of
        money that has been transfered to the loan. Loan must here of class
        loan
        property_value : value of the property 
        amount         : amount of money that represents the ownership. if 
                         amount=property_value, the property totally belongs to the owner, if
                         amount<property_value, the property partly belongs to the loan holder
        loan           : object of type loan, that is linked to this property
        date           : date, for which this property starts to exist
        name           : name of this property
        meta           : meta-information        
        """

        assert isinstance(
            loan,
            Loan), 'loan must be of type Loan, but is in fact of type ' + str(
                type(loan))
        assert property_value >= amount, 'property_value must be greater than amount'

        self._name = validate.valid_name(name)
        self._date_start = validate.valid_date(date)
        self._meta = meta

        self._property_value = int(property_value * 100)
        self._account = int(amount * 100)  # amount of money already invested
        self._caccount = self._account
        self._loan = loan

        # setting up the report and the semantics
        self._report = Report(name=self._name)

        self._report.add_semantics('account', 'saving_abs')
        self._report.add_semantics('property_value', 'none')

        self._current_date = self._date_start

        self.make_report()
Beispiel #3
0
 def __init__(self, name):
     """ Creates a dummy account class """
     self._name = validate.valid_name(name)