Commit 66b287a0 authored by Jason Rhinelander's avatar Jason Rhinelander

Minor test code compilation fixes

parent 779a7ae2
#include <eris/Simulation.hpp>
#include <eris/consumer/Quadratic.hpp>
#include <eris/Good.hpp>
#include <eris/good/Discrete.hpp>
#include <iostream>
#include <map>
#include <boost/format.hpp>
......@@ -20,11 +21,11 @@ int main() {
auto sim = Simulation::create();
// Set up a numeraire good
auto money = sim->spawn<Good::Continuous>("Money");
auto money = sim->spawn<Good>("Money");
// Plus another divisible good
auto x = sim->spawn<Good::Continuous>("x");
auto x = sim->spawn<Good>("x");
// And a discrete good
auto w = sim->spawn<Good::Discrete>("w");
auto w = sim->spawn<good::Discrete>("w");
// We have just a single consumer, with quaslinear quadratic utility in the x good
......@@ -52,13 +53,13 @@ int main() {
bool first = true;
cout << "Gradient:";
for (auto g : c1->gradient({money,x,w}, b)) {
for (auto g : c1->gradient({money->id(),x->id(),w->id()}, b)) {
cout << format(" %10g") % g.second;
}
cout << "\n\n";
first = true;
for (auto col : c1->hessian({money,x,w}, b)) {
for (auto col : c1->hessian({money->id(),x->id(),w->id()}, b)) {
if (first) { first = false; cout << "Hessian: "; }
else cout << " ";
......
......@@ -6,6 +6,7 @@
#include <eris/Agent.hpp>
#include <gtest/gtest.h>
#include <iostream>
#include <cmath>
#define INF std::numeric_limits<double>::infinity()
#define EXPECT_EQP(a,b) EXPECT_EQ(Position(a), b)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment