2 Feb 09:32
Re: A new approach for monitoring simulation data
Stefan Scherfke <stefan.scherfke <at> uni-oldenburg.de>
2010-02-02 08:32:46 GMT
2010-02-02 08:32:46 GMT
Hello Rayene,
Am 2010-01-20 um 12:23 schrieb Rayene Ben Rayana:
>
> Yeah, it is ugly :)
> Does ('name', lambda: self.name) work ?
Yep, seems to work:
>>> class A(object):
... foo = 3
...
>>> a = A()
>>> f = lambda: a.foo
>>> f()
3
>>> a.foo = 4
>>> f()
4
>>>
>>> Other things to think of :
>>>
>>> 1. An easy way to obtain a throughput plot (delta_value/delta_time)
>>> 2. Checking if the monitored data changed since last time. If not, give the user the possibility
>>> to skip the storage of that line.
>>>
>>> example :
>>> Instead of :
>>>
>>> [time, x, y]
>>> 1, 14, 5
>>> 2, 14, 5
>>> 3, 14, 5
>>> 4, 12, 6
>>>
>>> We can store :
>>> [time, x, y]
>>> 1, 14, 5
>>> 4, 12, 6
>>>
>>> Useful when data does not change too often.
>>
>> This is really a nice idea. I will discuss this with Ontje.
>
> Just keep in mind to let the user decide to activate it or not.
> It is a tradeoff between computing time and memory usage.
Do you have a concrete use case for this?
If your variables don’t change in an event, this event is useless and
could better be skipped (yield a longer hold). If – on the other hand –
only one variable value changes, you need to monitor anyways.
Maybe we can add a method like ``Monitor.last()`` which returns a tuple
with the last monitored values, so you can check for yourself:
if self.monitor.last() != (self.x , self.y):
self.monitor()
Cheers,
Stefan
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
RSS Feed