/********** Constructeur **********/
itsHybridContinuousInteractingAntColony::itsHybridContinuousInteractingAntColony()
{

  setName("Hybrid Continuous Interacting Ant Colony");
  setKey("HCIAC");
  setAccronym("HCIAC");
  setDescription("An agent-based ant colony algorithm hybrided with a nelder-mead local search");
  setCitation("");
  setFamily("Ant Colony Algorithm");

  // propri��

  probaUseMemoryThreshold = 0.5;
  probaUseMemoryPower = 10;
  
  probaUseMemoryMean = 0.5;
  probaUseMemoryStd = 0.2;
  
  probaUseNMSThreshold = 0.5;
  probaUseNMSPower = 10;
  
  spotsPersistence = 0.5;
  spotsMinValue = 0.0001;

  moveRangeStdRatio = 0.8;
  moveRangeMeanRatio = 0.5;

  nmsMaxEvals = 100;
}
Пример #2
0
LogDialog::LogDialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::LogDialog)
    , m_showError(true)
    , m_showWarning(true)
    , m_showNote(true)
    , m_showDebug(true)
    , m_showTrace(true)
{
    ui->setupUi(this);

    auto font = ui->textBrowserLog->font();
    font.setFamily("Monospace");
    ui->textBrowserLog->setFont(font);

    m_logDecorator = new LogDecorator(font, this);
    m_stringDecorator = new StringDecorator(this);
    m_threadNameDecorator = new ThreadNameDecorator(font, this);

    ui->labelLogFileName->setText(logFileName());

    addFilterCheckBox(LogError, &LogDialog::showError);
    addFilterCheckBox(LogWarning, &LogDialog::showWarning);
    addFilterCheckBox(LogNote, &LogDialog::showNote);
    addFilterCheckBox(LogDebug, &LogDialog::showDebug);
    addFilterCheckBox(LogTrace, &LogDialog::showTrace);
    ui->layoutFilters->addStretch(1);

    updateLog();
}
Пример #3
0
SpiralShapeFactory::SpiralShapeFactory(QObject *parent)
: KShapeFactoryBase(parent, SpiralShapeId, i18n("Spiral"))
{
    setToolTip(i18n("A spiral shape"));
    setIcon("spiral-shape");
    setFamily("geometric");
    setLoadingPriority(1);
}
Пример #4
0
void InetAddrSIM::setAddress(const std::string& address,
                                          const vpr::Uint32 port)
{
   mAddress = vpr::sim::DNS::instance()->lookupAddress(address);
   setPort( port );
   setFamily( vpr::SocketTypes::INET );
   setDebugData();
}
Пример #5
0
SpiralShapeFactory::SpiralShapeFactory()
: KoShapeFactoryBase(SpiralShapeId, QObject::tr("Spiral"))
{
    setToolTip(QObject::tr("A spiral shape"));
    setIconName(koIconNameCStr("spiral-shape"));
    setFamily("geometric");
    setLoadingPriority(1);
}
Пример #6
0
KoRectangleShapeFactory::KoRectangleShapeFactory( QObject *parent )
: KoShapeFactory( parent, KoRectangleShapeId, i18n( "A rectangle shape" ) )
{
    setToolTip( i18n( "A rectangle" ) );
    setIcon("rectangle-shape");
    setFamily("geometric");
    setOdfElementNames( KoXmlNS::draw, QStringList( "rect" ) );
    setLoadingPriority( 1 );
}
Пример #7
0
itsRandom::itsRandom()
{
    setName("Random algorithm");
    setKey("RA");
    setAccronym("RA");
    setDescription("Use random uniform distribution in searching space.");
    setCitation("Unknown");
    setFamily("Random algorithm");
}
Пример #8
0
NullLoopbackLayer::NullLoopbackLayer(uint32_t family)
{
	m_DataLen = sizeof(uint32_t);
	m_Data = new uint8_t[m_DataLen];
	memset(m_Data, 0, m_DataLen);
	m_Protocol = NULL_LOOPBACK;

	setFamily(family);
}
Пример #9
0
ScriptEdit::ScriptEdit(ScriptingEnv *env, QWidget *parent, QString name)
    : QTextEdit(parent, name),
      scripted(env),
      d_error(false),
      d_changing_fmt(false) {
  myScript = scriptEnv->newScript("", this, name);
  connect(myScript, SIGNAL(error(const QString &, const QString &, int)), this,
          SLOT(insertErrorMsg(const QString &)));
  connect(myScript, SIGNAL(print(const QString &)), this,
          SLOT(scriptPrint(const QString &)));

  setLineWrapMode(NoWrap);
  setTextFormat(Qt::PlainText);
  setAcceptRichText(false);
  setFamily("Monospace");

  new SyntaxHighlighter(document());

  d_fmt_default.setBackground(palette().brush(QPalette::Base));
  d_fmt_success.setBackground(QBrush(QColor(128, 255, 128)));
  d_fmt_failure.setBackground(QBrush(QColor(255, 128, 128)));

  printCursor = textCursor();

  actionExecute = new QAction(tr("E&xecute"), this);
  actionExecute->setShortcut(tr("Ctrl+J"));
  connect(actionExecute, SIGNAL(activated()), this, SLOT(execute()));

  actionExecuteAll = new QAction(tr("Execute &All"), this);
  actionExecuteAll->setShortcut(tr("Ctrl+Shift+J"));
  connect(actionExecuteAll, SIGNAL(activated()), this, SLOT(executeAll()));

  actionEval = new QAction(tr("&Evaluate Expression"), this);
  actionEval->setShortcut(tr("Ctrl+Return"));
  connect(actionEval, SIGNAL(activated()), this, SLOT(evaluate()));

  actionPrint =
      new QAction(IconLoader::load("edit-print", IconLoader::LightDark),
                  tr("&Print"), this);
  connect(actionPrint, SIGNAL(activated()), this, SLOT(print()));

  actionImport = new QAction(tr("&Import"), this);
  connect(actionImport, SIGNAL(activated()), this, SLOT(importASCII()));

  actionExport = new QAction(tr("&Export"), this);
  connect(actionExport, SIGNAL(activated()), this, SLOT(exportASCII()));

  functionsMenu = new QMenu(this);
  Q_CHECK_PTR(functionsMenu);
  connect(functionsMenu, SIGNAL(triggered(QAction *)), this,
          SLOT(insertFunction(QAction *)));

  connect(document(), SIGNAL(contentsChange(int, int, int)), this,
          SLOT(handleContentsChange(int, int, int)));
}
Пример #10
0
EllipseShapeFactory::EllipseShapeFactory()
    : KoShapeFactoryBase(EllipseShapeId, i18n("Ellipse"))
{
    setToolTip(i18n( "An ellipse"));
    setIcon("ellipse-shape");
    setFamily("geometric");
    QStringList elementNames;
    elementNames << "ellipse" << "circle";
    setOdfElementNames(KoXmlNS::draw, elementNames);
    setLoadingPriority(1);
}
itsSimulatedAnnealing::itsSimulatedAnnealing()
{
    setName("Simulated Annealing");
    setKey("SA");
    setAccronym("SA");
    setDescription("A simulated annealing where temperature is decreasing step by step.");
    setCitation("Unknown");
    setFamily("Simulated annealing");    

    temperature_max = 1;
    temperature = temperature_max;
}
itsHybridEstimationOfDistribution::itsHybridEstimationOfDistribution()
{
  setName("Continuous Hybrid Estimation of Distribution Algorithm");
  setKey("CHEDA");
  setAccronym("CHEDA");
  setDescription("An estimation of distribution algorithm hybrided with a nelder-mead local search");
  setCitation("");
  setFamily("Estimation of Distribution Algorithm");

  setIntensificationMethod("selection-simplex");

  setSimplexEvaluations( -1 );
}
Пример #13
0
JFont::JFont(int face, int style, int size)
  : QFont(), metrics(*this)
{
  int qfont_size;
  QString qfont_family;
  switch (size)
  {
    case SIZE_SMALL:
      qfont_size = QFONT_SIZE_SMALL;
      break;
      
    default:
    case SIZE_MEDIUM:
      qfont_size = QFONT_SIZE_MEDIUM;
      break;
      
    case SIZE_LARGE:
      qfont_size = QFONT_SIZE_LARGE;
      break;
  }
  setPointSize(qfont_size);
  
  switch (face)
  {
    case FACE_SYSTEM:
      qfont_family = QFONT_FAMILY_SYSTEM;
      break;
    
    default:
    case FACE_PROPORTIONAL:
      qfont_family = QFONT_FAMILY_PROPORTIONAL;
      break;
      
    case FACE_MONOSPACE:
      qfont_family = QFONT_FAMILY_MONOSPACE;
      break;
  }
  setFamily(qfont_family);

  if (style & STYLE_BOLD)
    setBold(true);
  if (style & STYLE_ITALIC)
    setItalic(true);
  if (style & STYLE_UNDERLINED)
    setUnderline(true);
  
  metrics = QFontMetrics(*this, JApplication::desktop()->screen());
  
  id = attrs2id(face, style, size);
  cache[id] = this;
}
Пример #14
0
bool KoOdfStyle::readOdf(KoXmlStreamReader &reader)
{
    // Load style attributes.
    KoXmlStreamAttributes  attrs = reader.attributes();
    QString dummy;              // Because the set*() methods take a QString &,

    dummy = attrs.value("style:family").toString();
    setFamily(dummy);
    dummy = attrs.value("style:name").toString();
    setName(dummy);
    dummy = attrs.value("style:parent-style-name").toString();
    setParent(dummy);
    dummy = attrs.value("style:display-name").toString();
    setDisplayName(dummy);

    kDebug() << "Style:" << name() << family() << parent() << displayName();

    // Load child elements: property sets and other children.
    while (reader.readNextStartElement()) {

        // So far we only have support for text-, paragraph- and graphic-properties
        QString propertiesType = reader.qualifiedName().toString();
        if (propertiesType == "style:text-properties"
            || propertiesType == "style:paragraph-properties"
            || propertiesType == "style:graphic-properties")
        {
            //kDebug() << "properties type: " << propertiesType;

            // Create a new propertyset variable depending on the type of properties.
            KoOdfStyleProperties *properties;
            if (propertiesType == "style:text-properties") {
                properties = new KoOdfTextProperties();
            }
            else if (propertiesType == "style:paragraph-properties") {
                properties = new KoOdfParagraphProperties();
            }
            else if (propertiesType == "style:graphic-properties") {
                properties = new KoOdfGraphicProperties();
            }


            if (!properties->readOdf(reader)) {
                return false;
            }
            d->properties[propertiesType] = properties;
        }
    }

    return true;
}
Пример #15
0
ExceptionOr<Ref<FontFace>> FontFace::create(JSC::ExecState& state, Document& document, const String& family, JSC::JSValue source, const Descriptors& descriptors)
{
    auto result = adoptRef(*new FontFace(document.fontSelector()));

    bool dataRequiresAsynchronousLoading = true;

    auto setFamilyResult = result->setFamily(family);
    if (setFamilyResult.hasException())
        return setFamilyResult.releaseException();

    if (source.isString()) {
        auto value = FontFace::parseString(source.getString(&state), CSSPropertySrc);
        if (!is<CSSValueList>(value.get()))
            return Exception { SYNTAX_ERR };
        CSSFontFace::appendSources(result->backing(), downcast<CSSValueList>(*value), &document, false);
    } else if (auto arrayBufferView = toUnsharedArrayBufferView(source))
        dataRequiresAsynchronousLoading = populateFontFaceWithArrayBuffer(result->backing(), arrayBufferView.releaseNonNull());
    else if (auto arrayBuffer = toUnsharedArrayBuffer(source)) {
        auto arrayBufferView = JSC::Uint8Array::create(arrayBuffer, 0, arrayBuffer->byteLength());
        dataRequiresAsynchronousLoading = populateFontFaceWithArrayBuffer(result->backing(), arrayBufferView.releaseNonNull());
    }

    // These ternaries match the default strings inside the FontFaceDescriptors dictionary inside FontFace.idl.
    auto setStyleResult = result->setStyle(descriptors.style.isEmpty() ? ASCIILiteral("normal") : descriptors.style);
    if (setStyleResult.hasException())
        return setStyleResult.releaseException();
    auto setWeightResult = result->setWeight(descriptors.weight.isEmpty() ? ASCIILiteral("normal") : descriptors.weight);
    if (setWeightResult.hasException())
        return setWeightResult.releaseException();
    auto setStretchResult = result->setStretch(descriptors.stretch.isEmpty() ? ASCIILiteral("normal") : descriptors.stretch);
    if (setStretchResult.hasException())
        return setStretchResult.releaseException();
    auto setUnicodeRangeResult = result->setUnicodeRange(descriptors.unicodeRange.isEmpty() ? ASCIILiteral("U+0-10FFFF") : descriptors.unicodeRange);
    if (setUnicodeRangeResult.hasException())
        return setUnicodeRangeResult.releaseException();
    auto setVariantResult = result->setVariant(descriptors.variant.isEmpty() ? ASCIILiteral("normal") : descriptors.variant);
    if (setVariantResult.hasException())
        return setVariantResult.releaseException();
    auto setFeatureSettingsResult = result->setFeatureSettings(descriptors.featureSettings.isEmpty() ? ASCIILiteral("normal") : descriptors.featureSettings);
    if (setFeatureSettingsResult.hasException())
        return setFeatureSettingsResult.releaseException();

    if (!dataRequiresAsynchronousLoading) {
        result->backing().load();
        ASSERT(result->backing().status() == CSSFontFace::Status::Success);
    }

    return WTFMove(result);
}
Пример #16
0
EllipseShapeFactory::EllipseShapeFactory()
    : KoShapeFactoryBase(EllipseShapeId, QObject::tr("Ellipse"))
{
    setToolTip(QObject::tr("An ellipse"));
    setIconName(koIconNameCStr("ellipse-shape"));
    setFamily("geometric");
    setLoadingPriority(1);

    QList<QPair<QString, QStringList> > elementNamesList;
    elementNamesList.append(qMakePair(QString(KoXmlNS::draw), QStringList("circle")));
    elementNamesList.append(qMakePair(QString(KoXmlNS::draw), QStringList("ellipse")));
    elementNamesList.append(qMakePair(QString(KoXmlNS::svg), QStringList("circle")));
    elementNamesList.append(qMakePair(QString(KoXmlNS::svg), QStringList("ellipse")));
    setXmlElements(elementNamesList);
}
Пример #17
0
void QFont::setRawName(const QString &name)
{
    detach();

    // from qfontdatabase_x11.cpp
    extern bool qt_fillFontDef(const QByteArray &xlfd, QFontDef *fd, int dpi, QtFontDesc *desc);

    if (!qt_fillFontDef(qt_fixXLFD(name.toLatin1()), &d->request, d->dpi, 0)) {
        qWarning("QFont::setRawName: Invalid XLFD: \"%s\"", name.toLatin1().constData());

        setFamily(name);
        setRawMode(true);
    } else {
        resolve_mask = QFont::AllPropertiesResolved;
    }
}
Пример #18
0
void InetAddrSIM::setAddress(const std::string& address)
{
   std::string::size_type pos;
   std::string host_addr, host_port;
   vpr::Uint32 port;

   // Extract the address and the port number from the given string.
   pos       = address.find( ":" );
   host_addr = address.substr( 0, pos );
   host_port = address.substr( pos + 1 );
   port      = (vpr::Uint32) atoi( host_port.c_str() );

   //setAddress( host_addr );
   mAddress = vpr::sim::DNS::instance()->lookupAddress( host_addr );
   setPort( port );
   setFamily( vpr::SocketTypes::INET );
   setDebugData();
}
Пример #19
0
/*!
    Sets a font by its system specific name. The function is
    particularly useful under X, where system font settings (for
    example X resources) are usually available in XLFD (X Logical Font
    Description) form only. You can pass an XLFD as \a name to this
    function.

    A font set with setRawName() is still a full-featured QFont. It can
    be queried (for example with italic()) or modified (for example with
    setItalic()) and is therefore also suitable for rendering rich text.

    If Qt's internal font database cannot resolve the raw name, the
    font becomes a raw font with \a name as its family.

    Note that the present implementation does not handle wildcards in
    XLFDs well, and that font aliases (file \c fonts.alias in the font
    directory on X11) are not supported.

    \sa rawName(), setRawMode(), setFamily()
*/
void QFont::setRawName( const QString &name )
{
    detach();

    // from qfontdatabase_x11.cpp
    extern bool qt_fillFontDef( const QCString &xlfd, QFontDef *fd, int screen );

    if ( ! qt_fillFontDef( qt_fixXLFD( name.latin1() ), &d->request, d->screen ) ) {
#ifdef QT_CHECK_STATE
	qWarning("QFont::setRawName(): Invalid XLFD: \"%s\"", name.latin1());
#endif // QT_CHECK_STATE

	setFamily( name );
	setRawMode( TRUE );
    } else {
	d->mask = QFontPrivate::Complete;
    }
}
Пример #20
0
Font::Font(const string& family, unsigned size) {
  setFamily(family);
  setSize(size);
  state.bold = false;
  state.italic = false;
}
Пример #21
0
void QFont::setRawName(const QString &name)
{
    setFamily(name);
}