[Flightgear-devel] new feature for condition: precision

2011-08-24 Thread Torsten Dreyer
Hi,

I have just pushed a little patch to SimGear to implement feature 
request #372 (http://code.google.com/p/flightgear-bugs/issues/detail?id=372)

This adds some fuzzy-logic to condition elements by introducing an 
optional precision element. Without the precision element the 
behavior is unchanged and existing conditions should evaluate as before.

The idea behind this is to make life easier for float/double comparisons.

Example:
condition
   equals
 property/more/or/less/pi/property
 value type=double3.14/value
 precision type=double0.001/precision
   /equals
/condition
evaluates to true if /more/or/less/pi is between 3.135 and 3.145 (both 
inclusive).

The precision element works for int, long, float and double properties. 
It has no meaning for bool properties as I could not think of any fuzzy 
logic between true and false.

For string properties, the precision element dictates the length of the 
strings to compare, so
condition
   equals
 property/type/of/navaid/property
 value type=stringVOR/value
 precision3/precision
   /equals
/condition

evaluates to true if /type/of/navaid contains VOR, VOR/DME or VORTAC but 
evaluates to false for VO, VAR etc.

Beware that the first element dictates the comparison type. If, in the 
first example the type of /more/or/less/pi is string (or unspecified), 
precision would be interpreted as an int resulting in a string compare 
with length of zero (always true, I assume).

Please let me know what you think...

Torsten

--
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] new feature for condition: precision

2011-08-24 Thread Durk Talsma

On 24 Aug 2011, at 21:50, Torsten Dreyer wrote:
 
 
 The precision element works for int, long, float and double properties. 
 It has no meaning for bool properties as I could not think of any fuzzy 
 logic between true and false.
 
Euuh, maybe :-)

 

--
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] new feature for condition: precision

2011-08-24 Thread Vivian Meazza
Durk,


I'm sure you can - it's just what we need for AI - Bayesian logic. 


Vivian


 

 

-Original Message-
From: Durk Talsma [mailto:durkt...@gmail.com] 
Sent: 24 August 2011 21:40
To: FlightGear developers discussions
Subject: Re: [Flightgear-devel] new feature for condition: precision

 

 

On 24 Aug 2011, at 21:50, Torsten Dreyer wrote:



The precision element works for int, long, float and double properties. 
It has no meaning for bool properties as I could not think of any fuzzy 
logic between true and false.

Euuh, maybe :-)

 

 

 

--
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel