Skip to content

Commit

Permalink
Merge branch 'master' of research:~rosejn/gosim
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrus Hall committed Feb 28, 2007
2 parents 71a41f8 + a0a69ab commit 524978d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/gosim/network.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def alive?
end end


def alive=(status) def alive=(status)
log "Setting alive= on #{nid}"
@alive = status @alive = status
@topo.node_alive(@addr, @alive) @topo.node_alive(@addr, @alive)
end end
Expand Down
3 changes: 1 addition & 2 deletions lib/gosim/simulation.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def reset


def set_timeout(time, is_periodic = false, &block) def set_timeout(time, is_periodic = false, &block)
SimTimeout.new(time, is_periodic, block) SimTimeout.new(time, is_periodic, block)
#log "#{@sid}: Timeout set for #{time}"
end end


def inspect def inspect
Expand Down Expand Up @@ -199,7 +198,7 @@ def run(end_time = MAX_INT)
@entities[cur_event.dest_id].send(cur_event.event_id, cur_event.data) @entities[cur_event.dest_id].send(cur_event.event_id, cur_event.data)
end end
rescue Exception => e rescue Exception => e
error "error occurred sending:\n#{cur_event.data.inspect}\nto destination: #{cur_event.dest_id}.#{cur_event.event_id}" error "GoSim error occurred sending:\n#{cur_event.data.inspect}\nto destination: #{cur_event.dest_id}.#{cur_event.event_id}"
puts "Exception: #{e}" puts "Exception: #{e}"
print e.backtrace.join("\n") print e.backtrace.join("\n")
stop stop
Expand Down
2 changes: 2 additions & 0 deletions test/benchmark.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,8 @@
$:.unshift(File.dirname(__FILE__) + '/../lib') $:.unshift(File.dirname(__FILE__) + '/../lib')


require 'rational'
require 'gosim' require 'gosim'

require 'rubygems' require 'rubygems'
require 'benchmark' require 'benchmark'


Expand Down

0 comments on commit 524978d

Please sign in to comment.