Changeset 8495:fc9c5e56dc52 in orange


Ignore:
Timestamp:
07/27/11 23:52:24 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
41cb2e25f61c94dead9e3110cbd152d97374dc25
Message:

Experimenting with cooling schedule.

Location:
source/orangeplot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/orangeplot/networkcurve.cpp

    r8494 r8495  
    2828 
    2929} 
    30  
     30/* 
    3131void NodeItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 
    3232{ 
     
    5353    } 
    5454} 
    55  
     55*/ 
    5656void NodeItem::set_coordinates(double x, double y) 
    5757{ 
     
    330330    double kk = 2 * k; 
    331331    double kk2 = kk * kk; 
     332 
     333    double cooling, cooling_switch, cooling_1, cooling_2; 
    332334    temperature = sqrt(area) / 5; 
    333     double cooling = exp(log(k / 10 / temperature) / steps); 
     335    cooling = exp(log(k / 10 / temperature) / steps); 
     336    if (steps > 20) 
     337    { 
     338        cooling_switch = sqrt(area) / 100; 
     339        cooling_1 = (temperature - cooling_switch) / 20; 
     340        cooling_2 = (cooling_switch - sqrt(area) / 2000 ) / (steps - 20); 
     341    } 
     342    else 
     343    { 
     344        cooling_switch = sqrt(area) / 1000; 
     345        cooling_1 = (temperature - cooling_switch) / steps; 
     346        cooling_2 = 0; 
     347    } 
     348 
    334349    qDebug() << "k " << k; 
    335350    // iterations 
     
    421436        } 
    422437 
    423         temperature = temperature * cooling; 
     438        //temperature = temperature * cooling; 
     439        //qDebug() << count << " " << temperature << " " << (temperature > cooling_switch); 
     440        if ((int)temperature > cooling_switch) 
     441        { 
     442            temperature -= cooling_1; 
     443        } 
     444        else 
     445        { 
     446            temperature -= cooling_2; 
     447        } 
     448 
    424449    } 
    425450    data_r =  data_rect(); 
  • source/orangeplot/networkcurve.h

    r8494 r8495  
    1414    virtual ~NodeItem(); 
    1515 
    16     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); 
     16    //virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); 
    1717 
    1818    void set_coordinates(double x, double y); 
Note: See TracChangeset for help on using the changeset viewer.