2013-07-28 19:03:06 -04:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2013-01-15 17:46:05 -05:00
|
|
|
module Mutant
|
|
|
|
class Mutation
|
|
|
|
# Neutral mutation
|
|
|
|
class Neutral < self
|
|
|
|
|
2013-07-04 18:54:50 -04:00
|
|
|
SYMBOL = 'neutral'
|
|
|
|
|
|
|
|
# Noop mutation, special case of neutral
|
|
|
|
class Noop < self
|
|
|
|
|
|
|
|
SYMBOL = 'noop'
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2013-01-15 17:46:05 -05:00
|
|
|
# Return identification
|
|
|
|
#
|
|
|
|
# @return [String]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def identification
|
2013-07-04 18:54:50 -04:00
|
|
|
"#{self.class::SYMBOL}:#{super}"
|
2013-01-15 17:46:05 -05:00
|
|
|
end
|
|
|
|
memoize :identification
|
|
|
|
|
|
|
|
# Test if killer is successful
|
|
|
|
#
|
|
|
|
# @param [Killer] killer
|
|
|
|
#
|
|
|
|
# @return [true]
|
|
|
|
# if killer did NOT killed mutation
|
|
|
|
#
|
|
|
|
# @return [false]
|
|
|
|
# otherwise
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def success?(killer)
|
|
|
|
!killer.killed?
|
|
|
|
end
|
|
|
|
|
2013-06-14 14:54:02 -04:00
|
|
|
end # Neutral
|
|
|
|
end # Mutation
|
|
|
|
end # Mutant
|