class NEAT::Critter::Phenotype
Phenotype part of the Critter¶ ↑
This is created by Evolver.
Attributes
code[RW]
Expressed code as a string (that was instance_eval()ed)
critter[RW]
Critter to which we belong
Public Class Methods
[](critter)
click to toggle source
# File lib/rubyneat/critter.rb, line 294 def self.[](critter) ph = Phenotype.new critter.controller ph.critter = critter ph.code = "## Phenotype Code %s for critter %s\n" % [ph.name, critter.name] return ph end
Public Instance Methods
express!()
click to toggle source
Take what is in code and express that!
# File lib/rubyneat/critter.rb, line 302 def express! instance_eval @code self end
stimulate()
click to toggle source
This function is re-written by Expressor – with parameters and all. It returns a “response” in the form of a response hash. TODO This is network activation, so we should rename this at a later date…
# File lib/rubyneat/critter.rb, line 310 def stimulate nil end
to_s()
click to toggle source
This gives us a complete
Calls superclass method
# File lib/rubyneat/critter.rb, line 315 def to_s "## %s\n%s" % [super, @code] end