Minsky
schema0::Minsky Struct Reference

#include <schema0.h>

Collaboration diagram for schema0::Minsky:
Collaboration graph

Public Types

typedef std::map< int, PortPorts
 
typedef std::map< int, WireWires
 
typedef std::map< int, GodleyIconGodleyItems
 
typedef std::map< int, OperationOperations
 
typedef std::map< int, GroupIconGroupIcons
 

Public Member Functions

 Minsky ()
 
 Minsky (classdesc::xml_unpack_t &data)
 
void removeIntVarOrphans ()
 

Public Attributes

Ports ports
 
Wires wires
 
GodleyTable godley
 
GodleyItems godleyItems
 
Operations operations
 
VariableManager variables
 
GroupIcons groupItems
 
Plots plots
 
double stepMin =0
 Runge-Kutta parameters. More...
 
double stepMax =1
 maximum step size More...
 
int nSteps =1
 number of steps per GUI update More...
 
double epsAbs =1e-3
 absolute error More...
 
double epsRel =1e-2
 relative error More...
 

Detailed Description

Definition at line 203 of file schema0.h.

Member Typedef Documentation

◆ GodleyItems

typedef std::map<int, GodleyIcon> schema0::Minsky::GodleyItems

Definition at line 211 of file schema0.h.

◆ GroupIcons

typedef std::map<int, GroupIcon> schema0::Minsky::GroupIcons

Definition at line 218 of file schema0.h.

◆ Operations

typedef std::map<int, Operation> schema0::Minsky::Operations

Definition at line 214 of file schema0.h.

◆ Ports

typedef std::map<int, Port> schema0::Minsky::Ports

Definition at line 205 of file schema0.h.

◆ Wires

typedef std::map<int, Wire> schema0::Minsky::Wires

Definition at line 206 of file schema0.h.

Constructor & Destructor Documentation

◆ Minsky() [1/2]

schema0::Minsky::Minsky ( )
inline

Definition at line 223 of file schema0.h.

223 {}

◆ Minsky() [2/2]

schema0::Minsky::Minsky ( classdesc::xml_unpack_t &  data)
inline

Definition at line 232 of file schema0.h.

References removeIntVarOrphans(), and xml_unpack().

233  {
234  ::xml_unpack(data,"root",*this);
236  }
void xml_unpack(classdesc::xml_unpack_t &, const classdesc::string &, classdesc::ref< ecolab::urand > &)
void removeIntVarOrphans()
Definition: schema0.cc:43
Here is the call graph for this function:

Member Function Documentation

◆ removeIntVarOrphans()

void schema0::Minsky::removeIntVarOrphans ( )

See ticket #329 and references within. At some stage, IntOp had no destructor, which leads to an orphaned, invisible integral variable, with invalid output port. This bit of code deals with corrupt schema files that have been caused by this problem.

Apparently schema0 files suffered from this problem too!

Definition at line 43 of file schema0.cc.

References minsky::VariableType::integral, and minsky::OperationType::integrate.

Referenced by Minsky().

44  {
45  set<string> intNames;
46  for (Operations::const_iterator o=operations.begin();
47  o!=operations.end(); ++o)
48  if (o->second.m_type==minsky::OperationType::integrate)
49  {
50  if (!o->second.m_description.empty())
51  intNames.insert(o->second.m_description);
52  else
53  if (!o->second.description.empty())
54  intNames.insert(o->second.description);
55  }
56 
57  IsOrphan isOrphan;
58  for (VariableManager::const_iterator v=variables.begin();
59  v!=variables.end(); ++v)
60  // an orphaned variable is an integral variable not attached to an integral and without
61  if (v->second.m_type==minsky::VariableType::integral &&
62  intNames.contains(v->second.name)==0)
63  isOrphan.insert(v->second.name);
64 
65  for (VariableManager::iterator i=variables.begin();
66  i!=variables.end();)
67  {
68  const VariableManager::iterator j=i++;
69  if (isOrphan(*j)) variables.erase(j);
70  }
71 
72  for (VariableManager::VariableValues::iterator i=variables.values.begin();
73  i!=variables.values.end();)
74  {
75  const VariableManager::VariableValues::iterator j=i++;
76  if (isOrphan(*j)) variables.values.erase(j);
77  }
78 
79  }
VariableValues values
map of ports to variables
Definition: schema0.h:122
Operations operations
Definition: schema0.h:215
VariableManager variables
Definition: schema0.h:216
Here is the caller graph for this function:

Member Data Documentation

◆ epsAbs

double schema0::Minsky::epsAbs =1e-3

absolute error

Definition at line 229 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ epsRel

double schema0::Minsky::epsRel =1e-2

relative error

Definition at line 230 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ godley

GodleyTable schema0::Minsky::godley

Definition at line 210 of file schema0.h.

◆ godleyItems

GodleyItems schema0::Minsky::godleyItems

Definition at line 212 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ groupItems

GroupIcons schema0::Minsky::groupItems

Definition at line 219 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ nSteps

int schema0::Minsky::nSteps =1

number of steps per GUI update

Definition at line 228 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ operations

Operations schema0::Minsky::operations

Definition at line 215 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ plots

Plots schema0::Minsky::plots

Definition at line 221 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ ports

Ports schema0::Minsky::ports

Definition at line 207 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ stepMax

double schema0::Minsky::stepMax =1

maximum step size

Definition at line 227 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ stepMin

double schema0::Minsky::stepMin =0

Runge-Kutta parameters.

minimum step size

Definition at line 226 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ variables

VariableManager schema0::Minsky::variables

Definition at line 216 of file schema0.h.

Referenced by schema1::Minsky::Minsky().

◆ wires

Wires schema0::Minsky::wires

Definition at line 208 of file schema0.h.

Referenced by schema1::Minsky::Minsky().


The documentation for this struct was generated from the following files: