prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Allow fixed seed for replication
  Figure out how to best handle running a model with a fixed seed, to ensure that it will produce the same result. and implement that.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `mesa/model.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 """
  3 The model class for Mesa framework.
  4 
  5 Core Objects: Model
  6 
  7 """
  8 import datetime as dt
  9 import random
  10 
  11 
  12 class Model:
  13     """ Base class for models. """
  14     def __init__(self, seed=None):
  15         """ Create a new model. Overload this method with the actual code to
  16         start the model.
  17 
  18         Args:
  19             seed: seed for the random number generator
  20 
  21         Attributes:
  22             schedule: schedule object
  23             running: a bool indicating if the model should continue running
  24 
  25         """
  26         if seed is None:
  27             self.seed = dt.datetime.now()
  28         else:
  29             self.seed = seed
  30         random.seed(seed)
  31         self.running = True
  32         self.schedule = None
  33 
  34     def run_model(self):
  35         """ Run the model until the end condition is reached. Overload as
  36         needed.
  37 
  38         """
  39         while self.running:
  40             self.step()
  41 
  42     def step(self):
  43         """ A single step. Fill in here. """
  44         pass
  45
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/mesa/model.py b/mesa/model.py
  --- a/mesa/model.py
  +++ b/mesa/model.py
  @@ -7,6 +7,7 @@
   """
   import datetime as dt
   import random
  +import numpy
   
   
   class Model:
  @@ -23,11 +24,14 @@
               running: a bool indicating if the model should continue running
   
           """
  +        # seed both the numpy and Python random number generators
           if seed is None:
               self.seed = dt.datetime.now()
           else:
               self.seed = seed
           random.seed(seed)
  +        numpy.random.seed(seed)
  +
           self.running = True
           self.schedule = None
  
verification_info: {"golden_diff": "diff --git a/mesa/model.py b/mesa/model.py\n--- a/mesa/model.py\n+++ b/mesa/model.py\n@@ -7,6 +7,7 @@\n \"\"\"\n import datetime as dt\n import random\n+import numpy\n \n \n class Model:\n@@ -23,11 +24,14 @@\n             running: a bool indicating if the model should continue running\n \n         \"\"\"\n+        # seed both the numpy and Python random number generators\n         if seed is None:\n             self.seed = dt.datetime.now()\n         else:\n             self.seed = seed\n         random.seed(seed)\n+        numpy.random.seed(seed)\n+\n         self.running = True\n         self.schedule = None\n", "issue": "Allow fixed seed for replication\nFigure out how to best handle running a model with a fixed seed, to ensure that it will produce the same result. and implement that.\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nThe model class for Mesa framework.\n\nCore Objects: Model\n\n\"\"\"\nimport datetime as dt\nimport random\n\n\nclass Model:\n    \"\"\" Base class for models. \"\"\"\n    def __init__(self, seed=None):\n        \"\"\" Create a new model. Overload this method with the actual code to\n        start the model.\n\n        Args:\n            seed: seed for the random number generator\n\n        Attributes:\n            schedule: schedule object\n            running: a bool indicating if the model should continue running\n\n        \"\"\"\n        if seed is None:\n            self.seed = dt.datetime.now()\n        else:\n            self.seed = seed\n        random.seed(seed)\n        self.running = True\n        self.schedule = None\n\n    def run_model(self):\n        \"\"\" Run the model until the end condition is reached. Overload as\n        needed.\n\n        \"\"\"\n        while self.running:\n            self.step()\n\n    def step(self):\n        \"\"\" A single step. Fill in here. \"\"\"\n        pass\n", "path": "mesa/model.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nThe model class for Mesa framework.\n\nCore Objects: Model\n\n\"\"\"\nimport datetime as dt\nimport random\nimport numpy\n\n\nclass Model:\n    \"\"\" Base class for models. \"\"\"\n    def __init__(self, seed=None):\n        \"\"\" Create a new model. Overload this method with the actual code to\n        start the model.\n\n        Args:\n            seed: seed for the random number generator\n\n        Attributes:\n            schedule: schedule object\n            running: a bool indicating if the model should continue running\n\n        \"\"\"\n        # seed both the numpy and Python random number generators\n        if seed is None:\n            self.seed = dt.datetime.now()\n        else:\n            self.seed = seed\n        random.seed(seed)\n        numpy.random.seed(seed)\n\n        self.running = True\n        self.schedule = None\n\n    def run_model(self):\n        \"\"\" Run the model until the end condition is reached. Overload as\n        needed.\n\n        \"\"\"\n        while self.running:\n            self.step()\n\n    def step(self):\n        \"\"\" A single step. Fill in here. \"\"\"\n        pass\n", "path": "mesa/model.py"}]}