plot_window.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
36 
37 
38 
40 
41 
42 //
43 // PUBLIC MEMBER FUNCTIONS:
44 //
45 
46 
48 {
49  next = 0;
50  aliasIdx = -1;
51 
54 
55  first = 0;
56  last = 0;
57 
58  number = 0;
59 
63 }
64 
65 
67  )
68 {
69  next = 0;
70  aliasIdx = -1;
71 
72  frequency = _frequency;
74 
75  first = 0;
76  last = 0;
77 
78  number = 0;
79 
83 }
84 
85 
87 {
88  next = rhs.next;
89  aliasIdx = rhs.aliasIdx;//-1
90 
91  frequency = rhs.frequency;
92 
93  first = 0;
94  last = 0;
95 
96  number = 0;
97 
98  /* if rhs plot_window list is not empty, add all option items... */
99  PlotWindowSubplot* current = rhs.first;
100 
101  while ( current != 0 )
102  {
103  addSubplot( *current );
104  current = current->getNext( );
105  }
106 
108 
112 
113 }
114 
115 
117 {
118  clearAllSubplots( );
119 }
120 
121 
123 {
124  if ( this != &rhs )
125  {
126  clearAllSubplots( );
127 
128 
129  next = rhs.next;
130  aliasIdx = rhs.aliasIdx;//-1
131 
132  frequency = rhs.frequency;
133 
134  /* if rhs plot_window list is not empty, add all option items... */
135  PlotWindowSubplot* current = rhs.first;
136 
137  while ( current != 0 )
138  {
139  addSubplot( *current );
140  current = current->getNext( );
141  }
142 
144 
148  }
149 
150  return *this;
151 }
152 
153 
155 {
156  return new PlotWindow( *this );
157 }
158 
159 
161 {
162  return SUCCESSFUL_RETURN;
163 }
164 
165 
167  )
168 {
169  init( );
170 
171  return replot( _frequency );
172 }
173 
174 
176  )
177 {
178  return SUCCESSFUL_RETURN;
179 }
180 
181 
182 returnValue PlotWindow::setTitle( uint idx, const char* const title_ )
183 {
184  if ( idx >= getNumSubplots( ) )
186 
187  return operator()( idx ).setTitle( title_ );
188 }
189 
190 returnValue PlotWindow::setLabelX( uint idx, const char* const xLabel_ )
191 {
192  if ( idx >= getNumSubplots( ) )
194 
195  return operator()( idx ).setXLabel( xLabel_ );
196 }
197 
198 
199 returnValue PlotWindow::setLabelY( uint idx, const char* const yLabel_ )
200 {
201  if ( idx >= getNumSubplots( ) )
203 
204  return operator()( idx ).setYLabel( yLabel_ );
205 }
206 
207 
209 {
210  if ( idx >= getNumSubplots( ) )
212 
213  return operator()( idx ).setPlotMode( plotMode_ );
214 }
215 
216 
218  double xRange1_,
219  double xRange2_,
220  double yRange1_,
221  double yRange2_
222  )
223 {
224  if ( idx >= getNumSubplots( ) )
226 
227  return operator()( idx ).setRanges( xRange1_,xRange2_,yRange1_,yRange2_ );
228 }
229 
230 
231 
233  double _lineValue
234  )
235 {
236  if ( idx >= getNumSubplots( ) )
238 
239  return operator()( idx ).addLine( _lineValue );
240 }
241 
242 
244  const VariablesGrid& _newData//,
245  //PlotMode plotMode
246  )
247 {
248  if ( idx >= getNumSubplots( ) )
250 
251  return operator()( idx ).addData( _newData );
252 }
253 
254 
256  )
257 {
258  return addSubplot( _subplot );
259 }
260 
261 
263  )
264 {
265  return addSubplot( _name );
266 }
267 
268 
270  )
271 {
272  return addSubplot( _name );
273 }
274 
275 
277  )
278 {
279  // create new item
280  PlotWindowSubplot* newItem = new PlotWindowSubplot( _subplot );
281 
282  if ( number == 0 )
283  {
284  first = newItem;
285  last = newItem;
286  }
287  else
288  {
289  if ( last->setNext( newItem ) != SUCCESSFUL_RETURN )
291  last = newItem;
292  }
293 
294  // add plot item for all possible plot objects
295  if ( addPlotDataItem( _subplot.getXVariableType( ) ) != SUCCESSFUL_RETURN )
297 
298  if ( addPlotDataItem( _subplot.getYVariableType( ) ) != SUCCESSFUL_RETURN )
300 
301  if ( addPlotDataItem( _subplot.getXPlotExpression( ) ) != SUCCESSFUL_RETURN )
303 
304  if ( addPlotDataItem( _subplot.getYPlotExpression( ) ) != SUCCESSFUL_RETURN )
306 
307  if ( addPlotDataItem( _subplot.getPlotEnum( ) ) != SUCCESSFUL_RETURN )
309 
310  ++number;
311 
312  return SUCCESSFUL_RETURN;
313 }
314 
315 
317  const char* const _title,
318  const char* const _xLabel,
319  const char* const _yLabel,
320  PlotMode _plotMode,
321  double _xRangeLowerLimit,
322  double _xRangeUpperLimit,
323  double _yRangeLowerLimit,
324  double _yRangeUpperLimit
325  ){
326 
327  uint run1;
328 
329  for( run1 = 0; run1 < _expression.getDim(); run1++ ){
330 
331  PlotWindowSubplot* newSubplot = new PlotWindowSubplot( _expression(run1),
332  _title,_xLabel,_yLabel,_plotMode,
333  _xRangeLowerLimit,_xRangeUpperLimit,
334  _yRangeLowerLimit,_yRangeUpperLimit );
335 
336  if ( number == 0 )
337  {
338  first = newSubplot;
339  last = newSubplot;
340  }
341  else
342  {
343  if ( last->setNext( newSubplot ) != SUCCESSFUL_RETURN )
345  last = newSubplot;
346  }
347 
348  Expression tmp( _expression(run1) );
349 
350  if ( addPlotDataItem( &tmp ) != SUCCESSFUL_RETURN )
352 
353  ++number;
354  }
355 
356  return SUCCESSFUL_RETURN;
357 }
358 
359 
361  const Expression& _expressionY,
362  const char* const _title,
363  const char* const _xLabel,
364  const char* const _yLabel,
365  PlotMode _plotMode,
366  double _xRangeLowerLimit,
367  double _xRangeUpperLimit,
368  double _yRangeLowerLimit,
369  double _yRangeUpperLimit
370  )
371 {
372 
373  ASSERT( _expressionX.getDim() == _expressionY.getDim() );
374 
375  uint run1;
376 
377  for( run1 = 0; run1 < _expressionX.getDim(); run1++ ){
378 
379  PlotWindowSubplot* newSubplot = new PlotWindowSubplot( _expressionX(run1),_expressionY(run1),
380  _title,_xLabel,_yLabel,_plotMode,
381  _xRangeLowerLimit,_xRangeUpperLimit,
382  _yRangeLowerLimit,_yRangeUpperLimit );
383 
384  if ( number == 0 )
385  {
386  first = newSubplot;
387  last = newSubplot;
388  }
389  else
390  {
391  if ( last->setNext( newSubplot ) != SUCCESSFUL_RETURN )
393  last = newSubplot;
394  }
395 
396  Expression tmpX( _expressionX(run1) );
397 
398  if ( addPlotDataItem( &tmpX ) != SUCCESSFUL_RETURN )
400 
401  Expression tmpY( _expressionY(run1) );
402 
403  if ( addPlotDataItem( &tmpY ) != SUCCESSFUL_RETURN )
405 
406  ++number;
407  }
408 
409  return SUCCESSFUL_RETURN;
410 }
411 
412 
413 
415  const char* const _title,
416  const char* const _xLabel,
417  const char* const _yLabel,
418  PlotMode _plotMode,
419  double _xRangeLowerLimit,
420  double _xRangeUpperLimit,
421  double _yRangeLowerLimit,
422  double _yRangeUpperLimit
423  )
424 {
425  PlotWindowSubplot* newSubplot = new PlotWindowSubplot( _name,
426  _title,_xLabel,_yLabel,_plotMode,
427  _xRangeLowerLimit,_xRangeUpperLimit,
428  _yRangeLowerLimit,_yRangeUpperLimit );
429 
430  // for certain PlotName, switch to logarithmic plot
431  if ( ( _name == PLOT_KKT_TOLERANCE ) ||
432  ( _name == PLOT_NORM_LAGRANGE_GRADIENT ) )
433  newSubplot->setPlotFormat( PF_LOG );
434 
435  if ( number == 0 )
436  {
437  first = newSubplot;
438  last = newSubplot;
439  }
440  else
441  {
442  if ( last->setNext( newSubplot ) != SUCCESSFUL_RETURN )
444  last = newSubplot;
445  }
446 
447  if ( addPlotDataItem( _name ) != SUCCESSFUL_RETURN )
449 
450  ++number;
451 
452  return SUCCESSFUL_RETURN;
453 }
454 
455 
457  const char* const _title,
458  const char* const _xLabel,
459  const char* const _yLabel,
460  PlotMode _plotMode,
461  double _xRangeLowerLimit,
462  double _xRangeUpperLimit,
463  double _yRangeLowerLimit,
464  double _yRangeUpperLimit ){
465 
466 
467  PlotWindowSubplot* newSubplot = new PlotWindowSubplot( _variable,
468  _title,_xLabel,_yLabel,_plotMode,
469  _xRangeLowerLimit,_xRangeUpperLimit,
470  _yRangeLowerLimit,_yRangeUpperLimit,
471  BT_FALSE );
472 
473  if ( number == 0 )
474  {
475  first = newSubplot;
476  last = newSubplot;
477  }
478  else
479  {
480  if ( last->setNext( newSubplot ) != SUCCESSFUL_RETURN )
482  last = newSubplot;
483  }
484 
485  ++number;
486 
487  return SUCCESSFUL_RETURN;
488 }
489 
490 
492  const char* const _title,
493  const char* const _xLabel,
494  const char* const _yLabel,
495  PlotMode _plotMode,
496  double _xRangeLowerLimit,
497  double _xRangeUpperLimit,
498  double _yRangeLowerLimit,
499  double _yRangeUpperLimit )
500 {
501 
502  PlotWindowSubplot* newSubplot = new PlotWindowSubplot( _variable,
503  _title,_xLabel,_yLabel,_plotMode,
504  _xRangeLowerLimit,_xRangeUpperLimit,
505  _yRangeLowerLimit,_yRangeUpperLimit,
506  BT_TRUE );
507 
508  if ( number == 0 )
509  {
510  first = newSubplot;
511  last = newSubplot;
512  }
513  else
514  {
515  if ( last->setNext( newSubplot ) != SUCCESSFUL_RETURN )
517  last = newSubplot;
518  }
519 
520  ++number;
521 
522  return SUCCESSFUL_RETURN;
523 }
524 
525 
527  double _xRangeLowerLimit,
528  double _xRangeUpperLimit,
529  const char* const _title,
530  const char* const _xLabel,
531  const char* const _yLabel,
532  PlotMode _plotMode,
533  double _yRangeLowerLimit,
534  double _yRangeUpperLimit
535  )
536 {
537  PlotWindowSubplot* newSubplot = new PlotWindowSubplot( _curve,
538  _xRangeLowerLimit,_xRangeUpperLimit,
539  _title,_xLabel,_yLabel,_plotMode,
540  _yRangeLowerLimit,_yRangeUpperLimit );
541 
542  if ( number == 0 )
543  {
544  first = newSubplot;
545  last = newSubplot;
546  }
547  else
548  {
549  if ( last->setNext( newSubplot ) != SUCCESSFUL_RETURN )
551  last = newSubplot;
552  }
553 
554  ++number;
555 
556  return SUCCESSFUL_RETURN;
557 }
558 
559 
561 {
562  PlotWindowSubplot* current = first;
563  PlotWindowSubplot* tmp;
564 
565  /* deallocate all PlotWindowSubplots within list */
566  while ( current != 0 )
567  {
568  tmp = current->getNext( );
569  delete current;
570  current = tmp;
571  }
572 
573  /* ... and initialise an empty list. */
574  first = 0;
575  last = 0;
576 
577  number = 0;
578 
579  return SUCCESSFUL_RETURN;
580 }
581 
582 
583 
584 //
585 // PROTECTED MEMBER FUNCTIONS:
586 //
587 
589  )
590 {
591  if ( _expression != 0 )
592  {
593  // use dedicated call for variables
594  if ( _expression->isVariable( ) == BT_TRUE )
595  return addPlotDataItem( _expression->getVariableType( ) );
596 
597  // otherwise add all log entries that might be needed
603 
605 
608  }
609 
610  return SUCCESSFUL_RETURN;
611 }
612 
613 
615  )
616 {
617  switch( _type )
618  {
621  break;
622 
623  case VT_ALGEBRAIC_STATE:
625  break;
626 
627  case VT_PARAMETER:
630  //plotDataRecord.addItem( LOG_SIMULATED_PARAMETERS );
631  break;
632 
633  case VT_CONTROL:
636  //plotDataRecord.addItem( LOG_SIMULATED_CONTROLS );
637  break;
638 
639  case VT_DISTURBANCE:
641  break;
642 
645  break;
646 
647  case VT_OUTPUT:
650  break;
651 
652  default:
653  break;
654  }
655 
658 
659  return SUCCESSFUL_RETURN;
660 }
661 
662 
664  )
665 {
666  LogName logName = convertPlotToLogName( _name );
667 
668  if ( logName != LOG_NOTHING )
669  return plotDataRecord.addItem( logName );
670 
672 
673  return SUCCESSFUL_RETURN;
674 }
675 
676 
677 
679  ) const
680 {
681  switch( _name )
682  {
683  case PLOT_KKT_TOLERANCE:
684  return LOG_KKT_TOLERANCE;
685  break;
686 
688  return LOG_OBJECTIVE_VALUE;
689 
692 
695 
698 
699  default:
700  return LOG_NOTHING;
701  }
702 }
703 
704 
706  ) const
707 {
708  switch( _name )
709  {
710  case LOG_KKT_TOLERANCE:
711  return PLOT_KKT_TOLERANCE;
712  break;
713 
714  case LOG_OBJECTIVE_VALUE:
715  return PLOT_OBJECTIVE_VALUE;
716 
719 
722 
725 
726  default:
727  return PLOT_NOTHING;
728  }
729 }
730 
731 
732 
734 {
735  LogFrequency logFrequency;
736 
737  switch ( _frequency )
738  {
739  case PLOT_AT_START:
740  logFrequency = LOG_AT_START;
741  break;
742 
743  case PLOT_AT_END:
744  logFrequency = LOG_AT_END;
745  break;
746 
747  default:
748  logFrequency = LOG_AT_EACH_ITERATION;
749  break;
750  }
751 
752  return plotDataRecord.setLogFrequency( logFrequency );
753 }
754 
755 
756 
758  VariableType& _type,
759  VariablesGrid& _dataGrid,
760  Grid& _discretizationGrid
761  )
762 {
763 
764  ASSERT( variable->isVariable() == BT_TRUE );
765 
766  VariablesGrid dataGridTmp, dataGridComponent;
767  int component = variable->getComponent(0);
768 
769  _type = variable->getVariableType();
770 
771  switch( _type )
772  {
775  break;
776 
777  case VT_ALGEBRAIC_STATE:
779  break;
780 
781  case VT_PARAMETER:
784  else
785  plotDataRecord.getLast( LOG_PARAMETERS,dataGridTmp );
786 
787  component = variable->getComponent(0);
788  if ( dataGridTmp.getNumValues( ) <= (uint)component )
790 
791  dataGridComponent = dataGridTmp(component);
792  dataGridComponent.setType( VT_PARAMETER );
793 
794  return getDataGrids( &dataGridComponent,_type,_dataGrid,_discretizationGrid );
795 
796  case VT_CONTROL:
799  else
800  plotDataRecord.getLast( LOG_CONTROLS,dataGridTmp );
801 
802  component = variable->getComponent(0);
803  if ( dataGridTmp.getNumValues( ) <= (uint)component )
805 
806  dataGridComponent = dataGridTmp(component);
807  dataGridComponent.setType( VT_CONTROL );
808 
809  return getDataGrids( &dataGridComponent,_type,_dataGrid,_discretizationGrid );
810 
811  case VT_DISTURBANCE:
812  plotDataRecord.getLast( LOG_DISTURBANCES,dataGridTmp );
813  break;
814 
817  break;
818 
819  case VT_OUTPUT:
822  else
824 
825  if ( dataGridTmp.getNumValues( ) > (uint)component )
826  _dataGrid = dataGridTmp(component);
827  else
829 
830  _discretizationGrid.init();
831  return SUCCESSFUL_RETURN;
832 
833  default:
834  // empty plot
836  }
837 
838  if ( dataGridTmp.getNumValues( ) > (uint)component )
839  _dataGrid = dataGridTmp(component);
840  else
842 
843  VariablesGrid tmp;
845  tmp.getGrid( _discretizationGrid );
846 
847  return SUCCESSFUL_RETURN;
848 }
849 
850 
852  VariableType& _type,
853  VariablesGrid& _dataGrid,
854  Grid& _discretizationGrid
855  )
856 {
857  OutputFcn f;
858  VariablesGrid loggedX,loggedXA,loggedP,loggedU,loggedW;
859 
860  _type = expression->getVariableType( );
861 
862  f << *expression;
863 
869 
870  if ( loggedP.isEmpty() == BT_FALSE )
871  loggedP.refineGrid( loggedX );
872 
873  if ( loggedU.isEmpty() == BT_FALSE )
874  loggedU.refineGrid( loggedX );
875 
876  if ( loggedW.isEmpty() == BT_FALSE )
877  loggedW.refineGrid( loggedX );
878 
879  returnValue returnvalue = f.evaluate( &loggedX,&loggedXA,&loggedP,&loggedU,&loggedW, &_dataGrid );
880  if( returnvalue != SUCCESSFUL_RETURN )
881  return ACADOERROR( returnvalue );
882 
883  VariablesGrid tmp;
885  tmp.getGrid( _discretizationGrid );
886 
887  return SUCCESSFUL_RETURN;
888 }
889 
890 
892  VariableType& _type,
893  VariablesGrid& _dataGrid,
894  Grid& _discretizationGrid
895  )
896 {
897  _dataGrid.init();
898  _discretizationGrid.init( );
899 
900  _type = variablesGrid->getType( );
901 
903  if ( ( _type == VT_CONTROL ) || ( _type == VT_PARAMETER ) )
904  mode = IM_CONSTANT;
905 
906  switch ( mode )
907  {
908  case IM_CONSTANT:
909  _discretizationGrid.addTime( 0.0 );
910 
911  for( uint i=0; i<variablesGrid->getNumPoints( )-1; ++i )
912  {
913  _dataGrid.addVector( variablesGrid->getVector(i),variablesGrid->getTime(i) );
914  _dataGrid.addVector( variablesGrid->getVector(i),variablesGrid->getTime(i+1) );
915  _discretizationGrid.addTime( (double)_dataGrid.getNumPoints() );
916  }
917  _dataGrid.addVector( variablesGrid->getLastVector(),variablesGrid->getLastTime() );
918  _discretizationGrid.addTime( (double)_dataGrid.getNumPoints() );
919  break;
920 
921  case IM_LINEAR:
922  _dataGrid = *variablesGrid;
923  break;
924 
925  default:
927  }
928 
929  _dataGrid.setType( _type );
930 
931  return SUCCESSFUL_RETURN;
932 }
933 
934 
935 
937  PlotFormat plotFormat,
938  double& lowerLimit,
939  double& upperLimit
940  ) const
941 {
942  double maxValue = dataGridY.getMax( );
943  double minValue = dataGridY.getMin( );
944  double meanValue = dataGridY.getMean( );
945 
946  if ( ( acadoIsZero( maxValue ) == BT_TRUE ) && ( acadoIsZero( minValue ) == BT_TRUE ) )
947  meanValue = 0.1 / 0.025;
948 
949  lowerLimit = minValue - 0.1*( maxValue-minValue ) - 0.025*meanValue - 1.0e-8;
950  upperLimit = maxValue + 0.1*( maxValue-minValue ) + 0.025*meanValue + 1.0e-8;
951 
952 
953  if ( ( plotFormat == PF_LOG ) || ( plotFormat == PF_LOG_LOG ) )
954  {
955  if ( ( acadoIsStrictlyGreater( minValue,0.0, ZERO ) == BT_TRUE ) && ( acadoIsGreater( lowerLimit,0.0, ZERO ) == BT_FALSE ) )
956  {
957  lowerLimit = ( minValue + acadoMin( minValue,EPS ) ) / sqrt(10.0);
958  upperLimit = upperLimit * sqrt(10.0);
959  }
960  }
961  else
962  {
963  if ( ( acadoIsStrictlyGreater( minValue,0.0, ZERO ) == BT_TRUE ) && ( acadoIsGreater( lowerLimit,0.0, ZERO ) == BT_FALSE ) )
964  lowerLimit = 0.0;
965 
966  if ( ( acadoIsStrictlySmaller( maxValue,0.0 ) == BT_TRUE ) && ( acadoIsSmaller( upperLimit,0.0 ) == BT_FALSE ) )
967  upperLimit = 0.0;
968  }
969 
970  return SUCCESSFUL_RETURN;
971 }
972 
973 
974 
975 
977 
978 
979 /*
980  * end of file
981  */
returnValue setXLabel(const std::string &_xLabel)
returnValue addData(const VariablesGrid &_newData)
BooleanType isVariable() const
returnValue setType(VariableType _type)
virtual returnValue replot(PlotFrequency _frequency=PLOT_IN_ANY_CASE)
returnValue setYLabel(const std::string &_yLabel)
returnValue addItem(LogName _name, const char *const _label=DEFAULT_LABEL)
Definition: log_record.cpp:70
IntermediateState sqrt(const Expression &arg)
returnValue evaluate(double *x, double *_result)
Definition: output_fcn.cpp:91
PlotWindowSubplot * getNext() const
virtual returnValue addLine(uint idx, double _lineValue)
Allows to setup and evaluate output functions based on SymbolicExpressions.
Definition: output_fcn.hpp:55
double getTime(uint pointIdx) const
uint getNumSubplots() const
virtual PlotWindow * clone() const
virtual returnValue plot(PlotFrequency _frequency=PLOT_IN_ANY_CASE)
virtual returnValue setLabelX(uint idx, const char *const xLabel_)
BEGIN_NAMESPACE_ACADO const double EPS
PlotMode
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
const double ZERO
virtual returnValue setTitle(uint idx, const char *const title_)
LogName convertPlotToLogName(PlotName _name) const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
returnValue getVariableDataGrids(const Expression *const variable, VariableType &_type, VariablesGrid &_dataGrid, Grid &_discretizationGrid)
Allows to conveniently handle (one-dimensional) grids consisting of time points.
Definition: grid.hpp:58
BooleanType isEmpty() const
PlotWindowSubplot * first
BooleanType acadoIsGreater(double x, double y, double TOL)
returnValue setTitle(const std::string &_title)
BooleanType shallPlotNominalControls
#define CLOSE_NAMESPACE_ACADO
returnValue addSubplot(PlotWindowSubplot &_subplot)
returnValue getLast(LogName _name, DMatrix &lastValue) const
Expression * getXPlotExpression() const
VariableType
Definition: acado_types.hpp:95
PlotFrequency
BooleanType acadoIsStrictlySmaller(double x, double y, double TOL)
Base class for all variables within the symbolic expressions family.
Definition: expression.hpp:56
returnValue addLine(double _lineValue)
Allows to setup and plot user-specified plot windows for algorithmic outputs.
Definition: plot_window.hpp:76
returnValue getExpressionDataGrids(const Expression *const expression, VariableType &_type, VariablesGrid &_dataGrid, Grid &_discretizationGrid)
VariableType getType() const
PlotName
PlotWindow & operator=(const PlotWindow &rhs)
virtual returnValue setRanges(uint idx, double xRange1, double xRange2, double yRange1, double yRange2)
returnValue addVector(const DVector &newVector, double newTime=-INFTY)
LogRecord plotDataRecord
returnValue setRanges(double _xRangeLowerLimit, double _xRangeUpperLimit, double _yRangeLowerLimit, double _yRangeUpperLimit)
returnValue addSubplot3D(const VariablesGrid &_variable, const char *const _title="", const char *const _xLabel="", const char *const _yLabel="", PlotMode _plotMode=PM_UNKNOWN, double _xRangeLowerLimit=INFTY, double _xRangeUpperLimit=INFTY, double _yRangeLowerLimit=INFTY, double _yRangeUpperLimit=INFTY)
returnValue operator<<(PlotWindowSubplot &_subplot)
PlotFormat
returnValue getGrid(Grid &_grid) const
DVector getLastVector() const
virtual returnValue setPlotMode(uint idx, PlotMode plotMode)
returnValue refineGrid(const Grid &arg, InterpolationMode mode=IM_CONSTANT)
virtual returnValue setLabelY(uint idx, const char *const yLabel_)
returnValue init()
LogName
LogFrequency
returnValue init(uint _nPoints=0, const double *const _times=0)
Definition: grid.cpp:107
returnValue setPlotMode(PlotMode _plotMode)
BooleanType acadoIsSmaller(double x, double y, double TOL)
virtual returnValue init()
Allows to work with piecewise-continous function defined over a scalar time interval.
Definition: curve.hpp:52
void rhs(const real_t *x, real_t *f)
virtual returnValue addData(uint idx, const VariablesGrid &_newData)
PlotWindow * next
int acadoMin(const int x, const int y)
Definition: acado_utils.cpp:76
#define ASSERT(x)
VariableType getYVariableType() const
#define BT_TRUE
Definition: acado_types.hpp:47
BooleanType acadoIsZero(double x, double TOL)
returnValue addPlotDataItem(VariableType _type)
Allows to manage sub-windows of user-specified plot windows for algorithmic outputs (for internal use...
VariableType getVariableType() const
returnValue addTime(double _time)
Definition: grid.cpp:339
uint getNumPoints() const
returnValue setupLogFrequency(PlotFrequency _frequency=PLOT_AT_EACH_ITERATION)
returnValue setNext(PlotWindowSubplot *const _next)
BooleanType shallPlotNominalOutputs
PlotWindowSubplot * last
DVector getVector(uint pointIdx) const
double getLastTime() const
uint getComponent(const unsigned int idx) const
Expression * getYPlotExpression() const
returnValue clearAllSubplots()
#define BEGIN_NAMESPACE_ACADO
#define BT_FALSE
Definition: acado_types.hpp:49
BooleanType shallPlotNominalParameters
returnValue getDataGrids(const VariablesGrid *const variablesGrid, VariableType &_type, VariablesGrid &_dataGrid, Grid &_discretizationGrid)
PlotName convertLogToPlotName(LogName _name) const
virtual ~PlotWindow()
returnValue setPlotFormat(PlotFormat _plotFormat)
PlotName getPlotEnum() const
returnValue setLogFrequency(LogFrequency _frequency)
BooleanType acadoIsStrictlyGreater(double x, double y, double TOL)
PlotFrequency frequency
VariableType getXVariableType() const
#define ACADOERROR(retval)
InterpolationMode
PlotWindowSubplot & operator()(uint idx)
returnValue getAutoScaleYLimits(const VariablesGrid &dataGridY, PlotFormat plotFormat, double &lowerLimit, double &upperLimit) const
uint getDim() const


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:59