actors :: Agent :: defaultinit
actors :: Agent :: greet_back
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
actors :: Agent :: defaultinit
actors :: Agent :: greet_back
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).
class Agent
actor
# Doing a step in the simulation
fun do_step do
end
fun end_step do clock_agent.async.finished_step
end
lib/actors/examples/agent_simulation/agent_simulation.nit:47,1--56,3
redef class Agent
var others = new Array[Agent]
var count = 0
fun greet(message: String, other: Agent) do other.async.greet_back("Hello back !")
fun greet_back(message: String) do
count -= 1
if count == 0 then end_step
end
redef fun do_step do
for o in others do
o.async.greet("Hello !", self)
count += 1
end
end
end
lib/actors/examples/agent_simulation/simple_simulation.nit:24,1--41,3