Skip to content

Commit c6d36b0

Browse files
committed
Fixed lifesim benchmark after changes to Algorithm.h.
1 parent ed834f5 commit c6d36b0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/benchmark/BenchmarkLifeSim.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ using std::get;
3939
enum class Seasons { summer, winter };
4040
enum class Migration { enter, leave };
4141

42+
template <typename T>
43+
struct Incrementer { T operator()(T v) const { return v+1; } };
44+
4245
typedef pair<int,int> PositionT;
4346

4447
template <typename D>
@@ -80,7 +83,7 @@ class Region : public ReactiveObject<D>
8083
return count > 0 ? food/count : 0;
8184
};
8285

83-
EventsT<int> FoodOutput = Pulse(FoodOutputPerDay, theTime.NewDay);
86+
EventsT<int> FoodOutput = Pulse(theTime.NewDay, FoodOutputPerDay);
8487

8588
Region(Time<D>& time, int x, int y):
8689
theTime { time },
@@ -211,7 +214,7 @@ class Animal : public ReactiveObject<D>
211214
//Event<bool> Migrating = EventSource<bool>();
212215

213216
SignalT<bool> ShouldMigrate = Hold(0, FoodReceived) < 10;
214-
EventsT<bool> Moving = Pulse(ShouldMigrate, theTime.NewDay);
217+
EventsT<bool> Moving = Pulse(theTime.NewDay, ShouldMigrate);
215218
};
216219

217220
///////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)