This code defines a simulation model for a cryptocurrency trading platform called "ZebraNFTModel." The model uses the Mesa library to simulate the behavior of customers and tokens on the platform. Here's a summary of the key components of the code:
Agent Classes:
Customer: Represents a customer or potential customer on the Zebpay platform. Customers have attributes such as affinity to Zebpay, affinity to cryptocurrency, a list of owned tokens, and breeding fees paid. ZebToken: Represents the tokens issued by Zebpay. Tokens have attributes like the number of mates, category, owners, and breed cost.
ZebraNFTModel Class:
This is the main simulation model class. It initializes the model with parameters like the number of customers, number of tokens, distribution parameters, category weights, mating cutoff, breeding choice type, transfer details, mating rate, and distribution option. It creates customer and token agents based on the specified parameters and assigns tokens to customers. The step method defines the main simulation steps, including mating and token transfers.
Breeding and Transfer Logic:
The breeding_choice method determines how customers select tokens for mating based on cost minimization, category maximization, or a random choice. The transfer_choice method determines how tokens are transferred between customers, either randomly or based on certain criteria. The mating_distribution method determines how mating pairs are selected, either randomly or based on a distribution.
Mating and Token Creation:
The mate method simulates the mating process between two customers, potentially creating a new token based on certain conditions like cost, category, and randomness. A new token is created, and its attributes are updated accordingly. Simulation Execution:
The code executes the simulation, iterating through steps, including mating and token transfers, based on the defined parameters.
Data Collection:
The code uses the Mesa DataCollector to collect data during the simulation, although the specific data being collected is not detailed in this snippet.
Randomization and Control Flow:
Randomization is used in various parts of the code to introduce randomness into agent behavior and decision-making. The code controls the flow of the simulation, ensuring that customers and tokens interact and evolve over time. This code provides the foundation for simulating the behavior of customers and tokens on a cryptocurrency trading platform and allows for experimentation with different parameters and strategies. It is a work in progress, and additional details about the specific objectives and outcomes of the simulation will be developed over a period of time.
Collaborators Krina Shah: [email protected] Nakiyah Dhariwala:: [email protected]