diff --git a/mesa/examples/basic/boid_flockers/app.py b/mesa/examples/basic/boid_flockers/app.py index 02fde323285..482d582b8ba 100644 --- a/mesa/examples/basic/boid_flockers/app.py +++ b/mesa/examples/basic/boid_flockers/app.py @@ -1,7 +1,6 @@ +from mesa.examples.basic.boid_flockers.model import BoidFlockers from mesa.visualization import Slider, SolaraViz, make_space_matplotlib -from .model import BoidFlockers - def boid_draw(agent): if not agent.neighbors: # Only for the first Frame diff --git a/mesa/examples/basic/boid_flockers/model.py b/mesa/examples/basic/boid_flockers/model.py index 2bc59216d67..a05caab1880 100644 --- a/mesa/examples/basic/boid_flockers/model.py +++ b/mesa/examples/basic/boid_flockers/model.py @@ -7,8 +7,7 @@ import numpy as np import mesa - -from .agents import Boid +from mesa.examples.basic.boid_flockers.agents import Boid class BoidFlockers(mesa.Model): diff --git a/mesa/examples/basic/boltzmann_wealth_model/app.py b/mesa/examples/basic/boltzmann_wealth_model/app.py index ebbb1ab3f1a..7e3f41e64de 100644 --- a/mesa/examples/basic/boltzmann_wealth_model/app.py +++ b/mesa/examples/basic/boltzmann_wealth_model/app.py @@ -1,11 +1,10 @@ +from mesa.examples.basic.boltzmann_wealth_model.model import BoltzmannWealthModel from mesa.visualization import ( SolaraViz, make_plot_measure, make_space_matplotlib, ) -from .model import BoltzmannWealthModel - def agent_portrayal(agent): size = 10 diff --git a/mesa/examples/basic/boltzmann_wealth_model/model.py b/mesa/examples/basic/boltzmann_wealth_model/model.py index a8e96a79ea3..03ef5a21634 100644 --- a/mesa/examples/basic/boltzmann_wealth_model/model.py +++ b/mesa/examples/basic/boltzmann_wealth_model/model.py @@ -1,6 +1,5 @@ import mesa - -from .agents import MoneyAgent +from mesa.examples.basic.boltzmann_wealth_model.agents import MoneyAgent class BoltzmannWealthModel(mesa.Model): diff --git a/mesa/examples/basic/conways_game_of_life/app.py b/mesa/examples/basic/conways_game_of_life/app.py index bff865a8d12..d7838efa453 100644 --- a/mesa/examples/basic/conways_game_of_life/app.py +++ b/mesa/examples/basic/conways_game_of_life/app.py @@ -4,7 +4,8 @@ import numpy as np import pandas as pd import streamlit as st -from model import ConwaysGameOfLife + +from mesa.examples.basic.conways_game_of_life.model import ConwaysGameOfLife model = st.title("Conway's Game of Life") num_ticks = st.slider("Select number of Steps", min_value=1, max_value=100, value=50) diff --git a/mesa/examples/basic/conways_game_of_life/model.py b/mesa/examples/basic/conways_game_of_life/model.py index cc3fa996409..6e81f690763 100644 --- a/mesa/examples/basic/conways_game_of_life/model.py +++ b/mesa/examples/basic/conways_game_of_life/model.py @@ -1,8 +1,7 @@ from mesa import Model +from mesa.examples.basic.conways_game_of_life.agents import Cell from mesa.space import SingleGrid -from .agents import Cell - class ConwaysGameOfLife(Model): """Represents the 2-dimensional array of cells in Conway's Game of Life.""" diff --git a/mesa/examples/basic/schelling/app.py b/mesa/examples/basic/schelling/app.py index 51989203593..72ae6ddc1ec 100644 --- a/mesa/examples/basic/schelling/app.py +++ b/mesa/examples/basic/schelling/app.py @@ -1,5 +1,6 @@ import solara +from mesa.examples.basic.schelling.model import Schelling from mesa.visualization import ( Slider, SolaraViz, @@ -7,8 +8,6 @@ make_space_matplotlib, ) -from .model import Schelling - def get_happy_agents(model): """Display a text count of how many happy agents there are.""" diff --git a/mesa/examples/basic/schelling/model.py b/mesa/examples/basic/schelling/model.py index fba0de7d4ac..aa390f14e96 100644 --- a/mesa/examples/basic/schelling/model.py +++ b/mesa/examples/basic/schelling/model.py @@ -1,7 +1,6 @@ import mesa from mesa import Model - -from .agents import SchellingAgent +from mesa.examples.basic.schelling.agents import SchellingAgent class Schelling(Model): diff --git a/mesa/examples/basic/virus_on_network/app.py b/mesa/examples/basic/virus_on_network/app.py index 0e85e8ac4fc..0183d256790 100644 --- a/mesa/examples/basic/virus_on_network/app.py +++ b/mesa/examples/basic/virus_on_network/app.py @@ -4,10 +4,13 @@ from matplotlib.figure import Figure from matplotlib.ticker import MaxNLocator +from mesa.examples.basic.virus_on_network.model import ( + State, + VirusOnNetwork, + number_infected, +) from mesa.visualization import Slider, SolaraViz, make_space_matplotlib -from .model import State, VirusOnNetwork, number_infected - def agent_portrayal(graph): def get_agent(node): diff --git a/mesa/examples/basic/virus_on_network/model.py b/mesa/examples/basic/virus_on_network/model.py index 04e457e8bf3..73419958617 100644 --- a/mesa/examples/basic/virus_on_network/model.py +++ b/mesa/examples/basic/virus_on_network/model.py @@ -4,8 +4,7 @@ import mesa from mesa import Model - -from .agents import State, VirusAgent +from mesa.examples.basic.virus_on_network.agents import State, VirusAgent def number_state(model, state):