Class: Pione::Agent::AgentState

Inherits:
StructX
  • Object
show all
Defined in:
lib/pione/agent/basic-agent.rb

Overview

AgentState represents a state of agent. The state is a pair of previous transiton and current transition.

Instance Method Summary collapse

Instance Method Details

#current?(state) ⇒ Boolean

Returns:

  • (Boolean)


334
335
336
# File 'lib/pione/agent/basic-agent.rb', line 334

def current?(state)
  current == state
end

#previous?(state) ⇒ Boolean

Returns:

  • (Boolean)


330
331
332
# File 'lib/pione/agent/basic-agent.rb', line 330

def previous?(state)
  previous == state
end

#to_sObject



338
339
340
# File 'lib/pione/agent/basic-agent.rb', line 338

def to_s
  "<%s=>%s>" % [previous, current]
end