[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[udig-devel] Choosing a Renderer based on metrics
|
I am setting down the ground work for choosing a renderer for one or
more layers ...
Here is a code snipit - Jesse am I on the right track here?
// Magic is defined as:
// 1) maximize accuracy - ie ability to render what the user says
on the style blackboard, rename "appearance"?
// 2) minimize latency - lets use real units for this one guys?
// 3) maximize thoughput - lets use real units for this one guys?
//
// Note we could of chosen total response time, but low latency is
worth more?
//
static final Comparator magic = new Comparator(){
public int compare( Object a, Object b ) {
RenderMetrics m1 = (RenderMetrics) a;
RenderMetrics m2 = (RenderMetrics) b;
if( m1.accuracy() > m2.accuracy() ) return -1;
if( m1.accuracy() < m2.accuracy() ) return 1;
if( m1.latency() < m2.latency() ) return -1;
if( m1.latency() > m2.latency() ) return 1;
if( m1.throughput() > m2.throughput() ) return -1;
if( m1.throughput() < m2.throughput() ) return 1;
return 0;
}
};
This comparator is used to sort a TreeSet of available RenderMetrics for
a Layer.