def test_fisheries_det_basic(engines, fisheries_scenario):
    (_engine, states, time_step, _start, steps, steady, steady_accuracy, optim_accuracy) = fisheries_scenario
    engine = engines[_engine]
    start = matrix(engine, _start)
    engine.cd(os.path.join(os.path.dirname(__file__), 'fisheries_det_basic'))
    engine.solve(float(states), float(time_step), nargout=0)
    final = numpy.array(engine.sim_final(start, steps))
    steady_one = numpy.dot(final, [(1 / 600), (5 / 4)])
    if steady:
        assert_allclose(steady_one, 1, atol=steady_accuracy)
        profit_max_steady = numpy.array([[302.5, 0.39667]])
        assert_allclose(final, profit_max_steady, rtol=optim_accuracy)
    else:
        assert (steady_one > (1 + steady_accuracy))
def test_fisheries_det_basic(engines, fisheries_scenario):
    (_engine, states, time_step, _start, steps, steady, steady_accuracy, optim_accuracy) = fisheries_scenario
    engine = engines[_engine]
    start = matrix(engine, _start)
    engine.cd(os.path.join(os.path.dirname(__file__), 'fisheries_det_basic'))
    engine.solve(float(states), float(time_step), nargout=0)
    final = numpy.array(engine.sim_final(start, steps))
    steady_one = numpy.dot(final, [(1 / 600), (5 / 4)])
    if steady:
        assert_allclose(steady_one, 1, atol=steady_accuracy)
        profit_max_steady = numpy.array([[302.5, 0.39667]])
        assert_allclose(final, profit_max_steady, rtol=optim_accuracy)
    else:
        assert (steady_one > (1 + steady_accuracy))