X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1fa3f778c3669d0658cf13b6da1a5c35b452a678..9b5c287fbf93c2ae7c3d18c8584647ef9920fe87:/examples/python/actor-create/actor-create.py diff --git a/examples/python/actor-create/actor-create.py b/examples/python/actor-create/actor-create.py index 3bd71d56f1..2c03dfa2b2 100644 --- a/examples/python/actor-create/actor-create.py +++ b/examples/python/actor-create/actor-create.py @@ -59,10 +59,12 @@ class Sender: Later, this actor class is instantiated twice in the simulation. """ - def __init__(self, msg = "GaBuZoMeu", mbox = "mb42"): + def __init__(self, msg="GaBuZoMeu", mbox="mb42"): self.msg = msg self.mbox = mbox + # Actors that are created as object will execute their __call__ method. + # So, the following constitutes the main function of the Sender actor. def __call__(self): this_actor.info("Hello s4u, I have something to send") mailbox = Mailbox.by_name(self.mbox) @@ -72,7 +74,7 @@ class Sender: if __name__ == '__main__': - """Here comes the main function of your program""" + # Here comes the main function of your program # When your program starts, you have to first start a new simulation engine, as follows e = Engine(sys.argv)