Example #1
0
void LegendItem::contextMenuEvent(QContextMenuEvent* event)
{
	QMenu menu;
	menu.addAction("Guarantee visibility", this, SIGNAL(GuaranteeVisibility()));
	menu.addSeparator();
	menu.addAction("Select samples", this, SIGNAL(SelectSamples()));
	menu.addSeparator();
	menu.addAction("Change properties", this, SIGNAL(ChangeProperties()));

	menu.exec(event->globalPos());
}
Example #2
0
void DESolver::RandToBest1Exp( int candidate )
{
  int r1, r2;
  int n;

  SelectSamples(candidate, &r1, &r2);
  n = (int)RandomUniform(0.0, (double)nDim);

  CopyVector(trialSolution, RowVector(population, candidate));
  for (int i = 0; (RandomUniform(0.0,1.0) < probability) && (i < nDim); i++) {
    trialSolution[n] += scale * (bestSolution[n] - trialSolution[n])
               + scale * (Element(population,r1,n)
               - Element(population,r2,n));
    n = (n + 1) % nDim;
  }

  return;
}
Example #3
0
void DESolver::Rand2Bin( int candidate )
{
  int r1, r2, r3, r4, r5;
  int n;

  SelectSamples(candidate, &r1, &r2, &r3, &r4, &r5);
  n = (int)RandomUniform(0.0, (double)nDim);

  CopyVector(trialSolution, RowVector(population, candidate));
  for (int i = 0; i < nDim; i++) {
    if ((RandomUniform(0.0,1.0) < probability) || (i  == (nDim - 1)))
      trialSolution[n] = Element(population,r1,n)
                + scale * (Element(population,r2,n)
                      + Element(population,r3,n)
                      - Element(population,r4,n)
                      - Element(population,r5,n));
    n = (n + 1) % nDim;
  }
}
Example #4
0
void DESolver::Best1Bin( int candidate )
{
  int r1, r2;
  int n;

  SelectSamples(candidate, &r1, &r2);
  n = (int)RandomUniform(0.0, (double)nDim);

  CopyVector(trialSolution, RowVector(population, candidate));
  for (int i = 0; i < nDim; i++) {
    if ((RandomUniform(0.0,1.0) < probability) || (i == (nDim - 1)))
      trialSolution[n] = bestSolution[n]
                + scale * (Element(population,r1,n)
                      - Element(population,r2,n));
    n = (n + 1) % nDim;
  }

  return;
}