@@ -0,0 +1,2932 @@
+from mesa import Agent%0Afrom abc import ABCMeta, abstractmethod%0A%0A%0Aclass AbstractCustomer(Agent,  metaclass=ABCMeta):%0A    def __init__(self, customer_id, transaction_model, fraudster):%0A        %22%22%22%0A        Abstract class for customers, which can either be genuine or fraudulent.%0A        :param customer_id: %0A        :param transaction_model: %0A        :param fraudster:                   whether customer is genuine (0) or fraudulent (1)%0A        %22%22%22%0A        super().__init__(customer_id, transaction_model)%0A%0A        # each customer has to say if it's a fraudster or not%0A        self.fraudster = fraudster%0A%0A        # variable for whether a transaction is currently being processed%0A        self.active = False%0A%0A        # pick country, currency, card%0A        self.country = self.pick_country()%0A        self.currency = self.pick_currency()%0A        self.card = self.pick_creditcard_number()%0A%0A        # fields for storing the current transaction properties%0A        self.curr_merchant = None%0A        self.curr_transaction_amount = None%0A%0A        # variable tells us whether the customer wants to stay after current transaction%0A        self.stay = True%0A%0A    def step(self):%0A        %22%22%22 %0A        This is called in each simulation step (i.e., one hour).%0A        Each individual customer/fraudster decides whether to make a transaction or  not.%0A        %22%22%22%0A        if self.decide_making_transaction():%0A            self.active = True%0A            self.make_transaction()%0A            self.stay = self.decide_staying_customer()%0A        else:%0A            self.active = False%0A            self.curr_merchant = None%0A            self.curr_transaction_amount = None%0A%0A    @abstractmethod%0A    def pick_country(self):%0A        %22%22%22%0A        Select country where customer's card was issued%0A        :return:    country%0A        %22%22%22%0A        pass%0A%0A    @abstractmethod%0A    def pick_currency(self):%0A        %22%22%22%0A        Select currency in which customer makes transactions%0A        :return:    string%0A        %22%22%22%0A        pass%0A%0A    @abstractmethod%0A    def pick_creditcard_number(self):%0A        %22%22%22 %0A        Select creditcard number (unique ID) for customer%0A        :return:    credit card number%0A        %22%22%22%0A        pass%0A%0A    @abstractmethod%0A    def decide_making_transaction(self):%0A        %22%22%22%0A        Decide whether to make transaction or not, given the current time step%0A        :return:    Boolean indicating whether to make transaction or not%0A        %22%22%22%0A        pass%0A%0A    @abstractmethod%0A    def make_transaction(self):%0A        %22%22%22%0A        Make a transaction. Should update these variables:%0A            self.curr_merchant, self.curr_transaction_amount%0A        %22%22%22%0A        pass%0A%0A    @abstractmethod%0A    def decide_staying_customer(self):%0A        %22%22%22 %0A        At a given point in time, decide whether or not to make another transaction in the future.%0A        :return:    Boolean indicating whether to make another transaction (stay=True) or not%0A        %22%22%22%0A        pass%0A

add abstract customer