MEPP2 Project
visibility.h
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as
6 // published by the Free Software Foundation; either version 3 of
7 // the License, or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 #pragma once
12 
13 #include "genericparametricmodel.h"
14 #include "psychometricfunction.h"
15 
16 //-----------------------------------------------------------------------------------
17 
27 
29  : public GenericParametricModel< WeibulPsychometricFunction,
30  Eigen::Vector2d,
31  double >
32 {
33 
34  //-----------------------------------------------------------------------------------
35 
36 public:
39  {
41  }
42 
45  {
46  }
47 
48  virtual ~VisibilityModel() {}
49 
50  //-----------------------------------------------------------------------------------
51 
52 public:
53  virtual void compute(const InputType &in, OutputType &out) const
54  {
55  double dc = in(0); // change in contrast
56  double T = in(1); // threshold
57 
58  if(T == 0.)
59  out = OutputType(dc == T);
60 
61  out = m_param(dc / T);
62  }
63 
64  //-----------------------------------------------------------------------------------
65 
66 protected:
68  virtual void default_params() { m_param = ParameterType(3.5); }
69 };
genericparametricmodel.h
GenericParametricModel< WeibulPsychometricFunction, Eigen::Vector2d, double >::InputType
Eigen::Vector2d InputType
Definition: genericparametricmodel.h:24
GenericParametricModel< WeibulPsychometricFunction, Eigen::Vector2d, double >::ParameterType
WeibulPsychometricFunction ParameterType
Definition: genericparametricmodel.h:23
VisibilityModel::compute
virtual void compute(const InputType &in, OutputType &out) const
Definition: visibility.h:53
VisibilityModel::VisibilityModel
VisibilityModel(const ParameterType &param)
Definition: visibility.h:43
VisibilityModel::default_params
virtual void default_params()
initialise the weibul distribution with beta = 3.5;
Definition: visibility.h:68
GenericParametricModel< WeibulPsychometricFunction, Eigen::Vector2d, double >::param
const ParameterType & param() const
Definition: genericparametricmodel.h:44
VisibilityModel
Definition: visibility.h:32
GenericParametricModel< WeibulPsychometricFunction, Eigen::Vector2d, double >::m_param
ParameterType m_param
Definition: genericparametricmodel.h:88
VisibilityModel::VisibilityModel
VisibilityModel()
Definition: visibility.h:37
psychometricfunction.h
WeibulPsychometricFunction
Definition: psychometricfunction.h:28
GenericParametricModel
Definition: genericparametricmodel.h:18
GenericParametricModel< WeibulPsychometricFunction, Eigen::Vector2d, double >::OutputType
double OutputType
Definition: genericparametricmodel.h:25
VisibilityModel::~VisibilityModel
virtual ~VisibilityModel()
Definition: visibility.h:48