[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
event display algorithm suggestions
All --
I'm writing a data structure that tries to serve up events in a
semi-intelligent way. The basic idea is that we have a set of events,
which each have a location and a time. Events have a priority, and higher
priority events are more likely to be displayed than low-priority events.
The way I'm thinking about the problem is to sort events along two axes:
spatial locality and temporal locality. Events which are happening soon
and which are close are more important than events which are far away in a
long time.
I'd appreciate feedback on this approach, if anyone has any good ideas for
thinking about how much to weight these factors. Here's what I've got,
roughly:
/**
* Method which computes the priority of an event based on its
* time, location, and type, and then dislays it.
*/
private void computerPriority(SignEvent se) {
// first compute how soon it is, and group into one of four buckets:
// 1. immediate (< 1 hour from now)
// 2. short term (< 12 hours from now)
// 3. medium term (< 2 days from now)
// 4. long term (> 2 days from now)
// second compute how close the event is
// 1. this locale (20M)
// 2. this building (100M)
// 3. this quadrant of campus (500M)
// 4. all others (2000M)
}
I get reasonable results using some home-grown weighings, but was
wondering if there was a more scientific approach i could use.
--
* * *
Patrick James Nichols II
Graduate Student, MIT Computer Graphics Group
http://graphics.csail.mit.edu/~pnichols