VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
prbStepFunction.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 #include <vlutil/vlMachineTypes.h>
15 #include <readerWriter/rwList.h>
16 #include <readerWriter/rwBoolean.h>
17 
18 class DtString;
20 class DtPrbValueList;
21 
22 
25 {
26 public:
27 
30 
32  DtPrbStepFunction(const DtString& name,
33  DtReaderWriterRegistry* parentRegistry = NULL);
34  DtPrbStepFunction(const DtSymbolString& name,
35  DtReaderWriterRegistry* parentRegistry = NULL);
36 
38  DtPrbStepFunction(const DtString& name, const
40  parentRegistry = NULL);
41  DtPrbStepFunction(const DtSymbolString& name, const
43  parentRegistry = NULL);
44 
45  const DtPrbStepFunction& operator=(const
46  DtPrbStepFunction& orig);
47 
49  virtual ~DtPrbStepFunction();
50 
51  virtual DtPrbStepFunction* clone(const DtString& name,
52  DtReaderWriterRegistry* parentRegistry = NULL) const;
53  virtual DtPrbStepFunction* clone(const DtSymbolString& name,
54  DtReaderWriterRegistry* parentRegistry = NULL) const;
55 
57  virtual int addTableEntry(const DtPrbValueList& tableEntry);
58 
64  virtual bool getProbabilities(DtReal value, DtPrbValueList* entry) const;
65 
68  virtual double minInputValue() const;
69 
72  virtual double maxInputValue() const;
73 
75  virtual double solveForMaximum() const;
76 
78  virtual bool isValid() const;
79 
80  bool operator==(const DtPrbStepFunction&) const;
81  bool operator!=(const DtPrbStepFunction& rhs) const
82  {
83  return !(*this == rhs);
84  }
85 
87  virtual bool removeValue(double);
88 
90  virtual double value(int index) const;
91 
94  virtual DtPrbValueList* changeValue(double oldValue, double newValue, int* newColumn = 0);
95 
97  virtual DtPrbValueList* changeValueForColumn(int col, double newRange, int* newColumn = 0);
98 
100  virtual DtListItem* lookupValue(double value) const;
101 
103  virtual int indexOfValue(double) const;
104 
107  virtual void setRoundDown(bool);
108  bool roundDown() const
109  {
110  return myRoundDown;
111  }
113 
115  virtual DtPrbValueList* changeValue(DtListItem* item, double newValue, int* newColumn = 0);
116 
119  void emptyList();
120 
123  void copyList(const DtPrbStepFunction & orig);
124 
125  virtual int addTableEntry(DtPrbValueList * tableEntry);
126 
130  virtual const char* readerWriterType() const;
131 
133  static const char* theXmlType();
134 
135  virtual const char* xmlType() const
136  {
137  return theXmlType();
138  }
139 
140 protected:
142  virtual void prePutSelf();
143  virtual void postPutSelf();
144 
146  virtual DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
147  const DtVariableBindingsList& variableBindings);
148 
149 protected:
152 };
153 
154 
155 
156 
157 
virtual void prePutSelf()
Called before either version of put self (file or environment). Default is no-op. ...
bool myRoundDown
Determines if step function should round input down or up to closest entry.
Definition: prbStepFunction.h:151
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
A Readable, Writable version of DtList. This class cannot be used directly, but must be inherited to ...
Definition: rwList.h:26
#define DT_DLL_vrfobjparam
This file is used to determine how to build.
Definition: vrfobjparamDefines.h:28
virtual const char * xmlType() const
Routines to archive/dearchive from an XML Environment.
Definition: prbStepFunction.h:135
virtual DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)=0
This method must be overridden by a subclass. Within this method, new instances of the DtReaderWriter...
Definition: prbStepFunction.h:24
static const char * theXmlType()
The type that is used when archiving to an XML stream.
Definition: readerWriterRegistry.h:39
DtPrbValueList.
Definition: prbValueList.h:19
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
bool operator!=(const DtPrbStepFunction &rhs) const
Definition: prbStepFunction.h:81
bool operator==(const DtRwList &rhs) const
Iterates over all items and calls the factory to compare.
bool roundDown() const
Accessor/mutator for myRoundDown.
Definition: prbStepFunction.h:108
const DtRwList & operator=(const DtRwList &orig)
Calls down to DtReaderWriter::operator=(). List elements are not copied.
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
virtual void postPutSelf()
Called after either version of put self (file or environment). Default is no-op.

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)