Data Modelling and visual representation for Collective Perception

Published: 22 December 2023| Version 1 | DOI: 10.17632/fzrkf8z5j5.1
Contributor:
Sunil Maria Benedict

Description

Model Components: 1. Agents: Each agent has: • Attributes (e.g., perception, behaviour, memory). • Decision-making rules (e.g., follow majority, imitate successful agents). • Perception of stimuli (e.g., based on neighbours' actions or external information). 2. Environment: • Space or network where agents interact. • Stimuli or signals that influence agents' perceptions. • Rules governing interaction and communication among agents. Simulation Steps: 1. Initialization: • Create a population of agents with initial attributes and perceptions. • Define the environment and initial stimuli. 2. Interaction: • Agents perceive stimuli from their environment or neighbours. • Agents update their attributes or behaviours based on perceived stimuli and predefined decision rules. • Agents interact with neighbours, influencing or being influenced by their actions. 3. Iteration: • Repeat the interaction steps for multiple time steps or iterations. • Observe how individual actions aggregate into collective behaviours. • Analyse emergent patterns, consensus, or divergence among agents.

Files

Steps to reproduce

import matplotlib.pyplot as plt import numpy as np # Initialize environment parameters grid_size = 20 num_agents = 30 interaction_radius = 2 # Initialize agent positions randomly agent_positions = np.random.randint(0, grid_size, size=(num_agents, 2)) # Function to find agents within interaction radius def find_neighbors(agent_idx): distances = np.linalg.norm(agent_positions - agent_positions[agent_idx], axis=1) neighbors = np.where((distances > 0) & (distances < interaction_radius))[0] return neighbors # Simulate agent movement and interaction for _ in range(10): # Simulate for 10 time steps for i, agent in enumerate(agent_positions): # Move agents randomly movement = np.random.randint(-1, 2, size=2) agent_positions[i] = np.clip(agent + movement, 0, grid_size - 1) # Interaction among neighbors neighbors = find_neighbors(i) if neighbors.size > 0: for neighbor_idx in neighbors: # Perform interaction or communication among agents (e.g., exchange information) pass # Visualize agent positions on the grid plt.figure(figsize=(6, 6)) plt.scatter(agent_positions[:, 0], agent_positions[:, 1], c='b', label='Agents') plt.title('Agent-Based Model - Collective Perception') plt.xlabel('X-axis') plt.ylabel('Y-axis') plt.legend() plt.grid(True) plt.xlim(0, grid_size) plt.ylim(0, grid_size) plt.show()

Institutions

CMR Group of institutions

Categories

Mathematics, Data Modeling, Financial Analysis, Financial Modelling, Stock Exchange, Stock Market Valuation

Licence