// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void GenericExample::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
/* FILTER_WIDGETCODEGEN_AUTO_GENERATED_CODE BEGIN*/

  reader->openFilterGroup(this, index);
  setStlFilePrefix( reader->readValue("StlFilePrefix", getStlFilePrefix()) );
  setMaxIterations( reader->readValue("MaxIterations", getMaxIterations()) );
  setMisorientationTolerance( reader->readValue("MisorientationTolerance", getMisorientationTolerance()) );
  setInputFile( reader->readValue("InputFile", getInputFile()) );
  setInputPath( reader->readValue("InputPath", getInputPath()) );
  setOutputFile( reader->readValue("OutputFile", getOutputFile()) );
  setOutputPath( reader->readValue("OutputPath", getOutputPath()) );
  setWriteAlignmentShifts( reader->readValue("WriteAlignmentShifts", getWriteAlignmentShifts()) );
  setConversionType( reader->readValue("ConversionType", getConversionType()) );
  setDimensions( reader->readValue("Dimensions", getDimensions()) );
  setOrigin( reader->readValue("Origin", getOrigin()) );
  setCrystalSymmetryRotations( reader->readValue("CrystalSymmetryRotations", getCrystalSymmetryRotations()) );

  setSelectedVoxelCellArrayName( reader->readValue("SelectedVoxelCellArrayName", getSelectedVoxelCellArrayName()) );
  setSelectedVoxelFieldArrayName( reader->readValue("SelectedVoxelFieldArrayName", getSelectedVoxelFieldArrayName()) );
  setSelectedVoxelEnsembleArrayName( reader->readValue("SelectedVoxelEnsembleArrayName", getSelectedVoxelEnsembleArrayName()) );
  setSelectedSurfaceMeshPointArrayName( reader->readValue("SelectedSurfaceMeshPointArrayName", getSelectedSurfaceMeshPointArrayName()) );
  setSelectedSurfaceMeshFaceArrayName( reader->readValue("SelectedSurfaceMeshFaceArrayName", getSelectedSurfaceMeshFaceArrayName()) );
  setSelectedSurfaceMeshEdgeArrayName( reader->readValue("SelectedSurfaceMeshEdgeArrayName", getSelectedSurfaceMeshEdgeArrayName()) );
  setSelectedSolidMeshPointArrayName( reader->readValue("SelectedSolidMeshPointArrayName", getSelectedSolidMeshPointArrayName()) );
  setSelectedSolidMeshFaceArrayName( reader->readValue("SelectedSolidMeshFaceArrayName", getSelectedSolidMeshFaceArrayName()) );
  setSelectedSolidMeshEdgeArrayName( reader->readValue("SelectedSolidMeshEdgeArrayName", getSelectedSolidMeshEdgeArrayName()) );


  setStrVector( reader->readValue("StrVector", getStrVector() ) );
  reader->closeFilterGroup();
}
Exemple #2
0
    Tree() {

        //  default values
        setStepSize(0.1);
        setMaxIterations(1000);
        setGoalMaxDist(0.1);
    }
	NodeTree(RRTNode* start)
	{
		_nodes.push_back(start);
		_numNodes = 1;
		setStepSize(0.25);
		// setGoalBias(0.26); // value between 0 and 1
		setMaxIterations(10000);
		setErrorFactor(1);
	}
	NodeTree()
	{
		//default values
		_numNodes = 1;
		setStepSize(0.25);
		// setGoalBias(0.26); // value between 0 and 1
		setMaxIterations(10000);
		setErrorFactor(1);
	}
Exemple #5
0
PathInt::PathInt()
 : m_sweeper(new Sweeper)
{
    setExecType(EsBase::Linear);
    setMaxIterations(1000); // n of sweeps
    setMinIterations(1);

    m_sweeper->setTotalSweeps(maxIterations());
//     printHeader("n,S");
}
Exemple #6
0
        Tree(std::shared_ptr<StateSpace<T>> stateSpace, bool reverse = false) {
            _stateSpace = stateSpace;
            _reverse = reverse;

            //  default values
            setStepSize(0.1);
            setMaxIterations(1000);
            setGoalBias(0);
            setWaypointBias(0);
            setGoalMaxDist(0.1);
        }
IntegraleDeterministico::IntegraleDeterministico(int a, int b)
  : IntegraleBase(a, b)
{
    setIntervalli(10);
    std::cout.precision(std::numeric_limits<real>::digits10 + 1);

//     m_f.assign("417.8077683550236335115029616847558823314866942"); // UNCOMMENT when using gmp numbers
    setMinIterations(2);
    setMaxIterations(pow(10, 6));
    setExecType(EsBase::Quadratic);

    printHeader("intervalli,trapezi,simpson,gauss");
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void TestFilter::readFilterParameters(AbstractFilterParametersReader* reader)
{
  setStlFilePrefix( reader->readValue("StlFilePrefix", StlFilePrefixDefaultValue) );
  setMaxIterations( reader->readValue("MaxIterations", MaxIterationsDefaultValue) );
  setMisorientationTolerance( reader->readValue("MisorientationTolerance", MisorientationToleranceDefaultValue) );
  setInputFile( reader->readValue("InputFile", InputFileDefaultValue) );
  setInputPath( reader->readValue("InputPath", InputPathDefaultValue) );
  setOutputFile( reader->readValue("OutputFile", OutputFileDefaultValue) );
  setOutputPath( reader->readValue("OutputPath", OutputPathDefaultValue) );
  setWriteAlignmentShifts( reader->readValue("WriteAlignmentShifts", WriteAlignmentShiftsDefaultValue) );
  setConversionType( reader->readValue("ConversionType", ConversionTypeDefaultValue) );
  setSelectedCellArrayName( reader->readValue("SelectedCellArrayName", SelectedCellArrayNameDefaultValue) );
  setSelectedFieldArrayName( reader->readValue("SelectedFieldArrayName", SelectedFieldArrayNameDefaultValue) );
  setSelectedEnsembleArrayName( reader->readValue("SelectedEnsembleArrayName", SelectedEnsembleArrayNameDefaultValue) );
  setSurfaceMeshPointArrayName( reader->readValue("SurfaceMeshPointArrayName", SurfaceMeshPointArrayNameDefaultValue) );
  setSurfaceMeshFaceArrayName( reader->readValue("SurfaceMeshFaceArrayName", SurfaceMeshFaceArrayNameDefaultValue) );
  setSurfaceMeshEdgeArrayName( reader->readValue("SurfaceMeshEdgeArrayName", SurfaceMeshEdgeArrayNameDefaultValue) );
  setSolidMeshPointArrayName( reader->readValue("SolidMeshPointArrayName", SolidMeshPointArrayNameDefaultValue) );
  setSolidMeshFaceArrayName( reader->readValue("SolidMeshFaceArrayName", SolidMeshFaceArrayNameDefaultValue) );
  setSolidMeshEdgeArrayName( reader->readValue("SolidMeshEdgeArrayName", SolidMeshEdgeArrayNameDefaultValue) );

  setCellComparisonInputs( reader->readValue("CellComparisonInputs", m_CellComparisonInputs) );
  setAxisAngleRotations( reader->readValue("AxisAngleRotations", m_AxisAngleRotations) );
}
bool LaserMapping::setup(ros::NodeHandle& node, ros::NodeHandle& privateNode)
{
   // fetch laser mapping params
   float fParam;
   int iParam;

   if (privateNode.getParam("scanPeriod", fParam))
   {
      if (fParam <= 0)
      {
         ROS_ERROR("Invalid scanPeriod parameter: %f (expected > 0)", fParam);
         return false;
      }
      else
      {
         setScanPeriod(fParam);
         ROS_INFO("Set scanPeriod: %g", fParam);
      }
   }

   if (privateNode.getParam("maxIterations", iParam))
   {
      if (iParam < 1)
      {
         ROS_ERROR("Invalid maxIterations parameter: %d (expected > 0)", iParam);
         return false;
      }
      else
      {
         setMaxIterations(iParam);
         ROS_INFO("Set maxIterations: %d", iParam);
      }
   }

   if (privateNode.getParam("deltaTAbort", fParam))
   {
      if (fParam <= 0)
      {
         ROS_ERROR("Invalid deltaTAbort parameter: %f (expected > 0)", fParam);
         return false;
      }
      else
      {
         setDeltaTAbort(fParam);
         ROS_INFO("Set deltaTAbort: %g", fParam);
      }
   }

   if (privateNode.getParam("deltaRAbort", fParam))
   {
      if (fParam <= 0)
      {
         ROS_ERROR("Invalid deltaRAbort parameter: %f (expected > 0)", fParam);
         return false;
      }
      else
      {
         setDeltaRAbort(fParam);
         ROS_INFO("Set deltaRAbort: %g", fParam);
      }
   }

   if (privateNode.getParam("cornerFilterSize", fParam))
   {
      if (fParam < 0.001)
      {
         ROS_ERROR("Invalid cornerFilterSize parameter: %f (expected >= 0.001)", fParam);
         return false;
      }
      else
      {
         downSizeFilterCorner().setLeafSize(fParam, fParam, fParam);
         ROS_INFO("Set corner down size filter leaf size: %g", fParam);
      }
   }

   if (privateNode.getParam("surfaceFilterSize", fParam))
   {
      if (fParam < 0.001)
      {
         ROS_ERROR("Invalid surfaceFilterSize parameter: %f (expected >= 0.001)", fParam);
         return false;
      }
      else
      {
         downSizeFilterSurf().setLeafSize(fParam, fParam, fParam);
         ROS_INFO("Set surface down size filter leaf size: %g", fParam);
      }
   }

   if (privateNode.getParam("mapFilterSize", fParam))
   {
      if (fParam < 0.001)
      {
         ROS_ERROR("Invalid mapFilterSize parameter: %f (expected >= 0.001)", fParam);
         return false;
      }
      else
      {
         downSizeFilterMap().setLeafSize(fParam, fParam, fParam);
         ROS_INFO("Set map down size filter leaf size: %g", fParam);
      }
   }

   // advertise laser mapping topics
   _pubLaserCloudSurround = node.advertise<sensor_msgs::PointCloud2>("/laser_cloud_surround", 1);
   _pubLaserCloudFullRes  = node.advertise<sensor_msgs::PointCloud2>("/velodyne_cloud_registered", 2);
   _pubOdomAftMapped      = node.advertise<nav_msgs::Odometry>("/aft_mapped_to_init", 5);

   // subscribe to laser odometry topics
   _subLaserCloudCornerLast = node.subscribe<sensor_msgs::PointCloud2>
      ("/laser_cloud_corner_last", 2, &LaserMapping::laserCloudCornerLastHandler, this);

   _subLaserCloudSurfLast = node.subscribe<sensor_msgs::PointCloud2>
      ("/laser_cloud_surf_last", 2, &LaserMapping::laserCloudSurfLastHandler, this);

   _subLaserOdometry = node.subscribe<nav_msgs::Odometry>
      ("/laser_odom_to_init", 5, &LaserMapping::laserOdometryHandler, this);

   _subLaserCloudFullRes = node.subscribe<sensor_msgs::PointCloud2>
      ("/velodyne_cloud_3", 2, &LaserMapping::laserCloudFullResHandler, this);

   // subscribe to IMU topic
   _subImu = node.subscribe<sensor_msgs::Imu>("/imu/data", 50, &LaserMapping::imuHandler, this);

   return true;
}
void
MultiAgentEnvironment::load()
{
    if (m_MultiAgentEnvironment)
    {
        ++m_NbrTotalEpisodes;

        m_CheckboxSaveStats->setEnabled( false );
        m_CheckboxSaveEpisodeStats->setEnabled( false );

        m_Time.start();

        cout << "Load scenario: '" << m_ScenarioFileName.c_str() << "'" << endl;

        m_MultiAgentEnvironment->load( m_ScenarioFileName.c_str() );
        m_MultiAgentEnvironment->disturb();

        if (m_CheckboxMaxIterations->isChecked())
        {
            setMaxIterations( m_SpinboxMaxIterations->value() );
        }
        else
        {
            setMaxIterations( m_MultiAgentEnvironment->getMaxIterations() );
        }

        Ipseity::String file_name;
        char* mode;

        if (m_LearningMode)
        {
            mode = "l";
        }
        else
        {
            mode = "e";
        }

        file_name = m_VolatileVariables.m_Workspace;
        file_name += "stats_";
        file_name += mode;
        file_name += ".txt";

        if (m_CheckboxSaveStats->isChecked())
        {
            m_StatFile = fopen( file_name.c_str(), "a" );
        }
        else
        {
            m_StatFile = NULL;
        }

        if (m_CheckboxSaveEpisodeStats->isChecked())
        {
			char ep_filename[256];

            sprintf( ep_filename, "%sstats_%s_t%06d_ep%08d.txt", m_VolatileVariables.m_Workspace.c_str(), mode, m_TrialId, m_EpisodeId );
			m_EpisodeStatFile = fopen( ep_filename, "a" );

            sprintf( ep_filename, "%sinteractions_%s_t%06d_ep%08d.txt", m_VolatileVariables.m_Workspace.c_str(), mode, m_TrialId, m_EpisodeId );
			m_EpisodeInteractionsFile = fopen( ep_filename, "a" );
        }
        else
        {
            m_EpisodeStatFile = NULL;
			m_EpisodeInteractionsFile = NULL;
        }
    }
    else
    {
#ifdef TRACE
        cout << g_ClassName << g_Errors[ERR_LOAD] << endl;
#endif
    }
}
SimannealConfigDialog::SimannealConfigDialog(QWidget *parent):
    QFDialog(parent)
{
    // setup widgets

    QVBoxLayout* main=new QVBoxLayout();
    setLayout(main);


    QGridLayout* grid=new QGridLayout();
    QLabel* l;

    l=new QLabel(tr("Maximum Iterations:"), this);
    l->setAlignment(Qt::AlignRight);
    spinMaxIterations=new QSpinBox(this);
    spinMaxIterations->setRange(100,1000000);
    spinMaxIterations->setSingleStep(100);
    l->setBuddy(spinMaxIterations);
    grid->addWidget(l, 0, 0);
    grid->addWidget(spinMaxIterations, 0, 1);
    grid->addWidget(new QLabel(tr("The maximum number of iterations that the Levenberg-Marquardt algorithm will go through before it halts."), this), 0, 2);

    l=new QLabel(tr("Initial Temperature T<sub>0</sub>:"), this);
    l->setAlignment(Qt::AlignRight);
    neditT0=new QFDoubleEdit(this);
    neditT0->setRange(0, 1e6);
    neditT0->setSingleStep(0.001);
    neditT0->setDecimals(12);
    l->setBuddy(neditT0);
    grid->addWidget(l, 1, 0);
    grid->addWidget(neditT0, 1, 1);
    grid->addWidget(new QLabel(tr("The initial temperature is set to be T<sub>start</sub>=T<sub>0</sub>&middot;&chi;<sup>2</sup>(<b>p</b><sub>start</sub>), depending on the initial parameters <b>p</b><sub>start</sub>."), this), 1, 2);

    l=new QLabel(tr("Temperature Decrease Rate r<sub>T</sub>:"), this);
    l->setAlignment(Qt::AlignRight);
    neditRT=new QFDoubleEdit(this);
    neditRT->setRange(0, 1e6);
    neditRT->setSingleStep(0.001);
    neditRT->setDecimals(12);
    l->setBuddy(neditRT);
    grid->addWidget(l, 2, 0);
    grid->addWidget(neditRT, 2, 1);
    grid->addWidget(new QLabel(tr("constant for temperature decrease: T<sub>new</sub> = r<sub>T</sub> &middot; T<sub>old</sub>"), this), 2, 2);

    l=new QLabel(tr("convergence parameter f<sub>max</sub>:"), this);
    l->setAlignment(Qt::AlignRight);
    neditFMax=new QFDoubleEdit(this);
    neditFMax->setRange(0, 1e6);
    neditFMax->setSingleStep(0.001);
    neditFMax->setDecimals(12);
    l->setBuddy(neditFMax);
    grid->addWidget(l, 3, 0);
    grid->addWidget(neditFMax, 3, 1);
    grid->addWidget(new QLabel(tr("if |&chi;<sup>2</sup><sub>opt, i-1</sub> - &chi;<sup>2</sup><sub>opt, i</sub>| &lt; f<sub>max</sub> the algorithm is said to have converged."), this), 3, 2);

    l=new QLabel(tr("step update constant c:"), this);
    l->setAlignment(Qt::AlignRight);
    neditC=new QFDoubleEdit(this);
    neditC->setRange(0, 1e6);
    neditC->setSingleStep(0.001);
    neditC->setDecimals(12);
    l->setBuddy(neditC);
    grid->addWidget(l, 4, 0);
    grid->addWidget(neditC, 4, 1);
    grid->addWidget(new QLabel(tr("constant for the update of the step vectors"), this), 4, 2);

    l=new QLabel(tr("Step Size Variations N<sub>S</sub>:"), this);
    l->setAlignment(Qt::AlignRight);
    spinNS=new QSpinBox(this);
    spinNS->setRange(1,100000000);
    spinNS->setSingleStep(100);
    l->setBuddy(spinNS);
    grid->addWidget(l, 5, 0);
    grid->addWidget(spinNS, 5, 1);
    grid->addWidget(new QLabel(tr("The number of variations of the step length before convergence check."), this), 5, 2);

    l=new QLabel(tr("Monte-Carlo Steps per Step Size N<sub>T</sub>:"), this);
    l->setAlignment(Qt::AlignRight);
    spinNT=new QSpinBox(this);
    spinNT->setRange(1,100000000);
    spinNT->setSingleStep(100);
    l->setBuddy(spinNT);
    grid->addWidget(l, 6, 0);
    grid->addWidget(spinNT, 6, 1);
    grid->addWidget(new QLabel(tr("Number of Monte-Carlo steps with each step size configuration."), this), 6, 2);

    l=new QLabel(tr("Maximum Iterations:"), this);
    l->setAlignment(Qt::AlignRight);
    spinNEpsilon=new QSpinBox(this);
    spinNEpsilon->setRange(1,100000000);
    spinNEpsilon->setSingleStep(100);
    l->setBuddy(spinNEpsilon);
    grid->addWidget(l, 7, 0);
    grid->addWidget(spinNEpsilon, 7, 1);
    grid->addWidget(new QLabel(tr("The Algorithm looks at the past N<sub>epsilon</sub> values of &chi;<sup>2</sup>(<b>p</b>) to check convergence."), this), 7, 2);



    main->addLayout(grid, 10);

    buttons=new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, Qt::Horizontal, this);
    connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
    main->addWidget(buttons, 0);



    // set default initial values, defined in header file
    setFMax();
    setT0();
    setC();
    setNS();
    setNT();
    setNEpsilon();
    setRT();
    setMaxIterations();
}