danionita / e3tools

e3tool is a Java GUI-based tool for constructing and evaluating e3value models. Includes the e3fraud fraud assessment extension
Other
3 stars 4 forks source link

Value propagation from ports to edges #60

Closed bobismijnnaam closed 7 years ago

bobismijnnaam commented 7 years ago

We keep forgetting to talk about this, but I'm not sure if I implemented it at some point, so lets document it to get rid of my doubt. What needs to be propagated from the value ports to the edges, and when? When the user edits the properties of a value exchange, and one of the value ports has valuation set, should the property window show that valuation? If a value exchanges has the valuation set, should both ports "inherit" this valuation setting when editing their properties? Should this inheritance also be applied when exporting to RDF?

danionita commented 7 years ago

As far as I know, you'e implemented the second option a while ago. That is, if the valuation of a value exchange is changed, it should propagate to both its ports. If the valuation of a port is changed, it only applies to that port.

On Sun, Sep 11, 2016 at 2:59 PM, Bob Rubbens notifications@github.com wrote:

We keep forgetting to talk about this, but I'm not sure if I implemented it at some point, so lets document it to get rid of my doubt. What needs to be propagated from the value ports to the edges, and when? When the user edits the properties of a value exchange, and one of the value ports has valuation set, should the property window show that valuation? If a value exchanges has the valuation set, should both ports "inherit" this valuation setting when editing their properties? Should this inheritance also be applied when exporting to RDF?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/danionita/e3tools/issues/60, or mute the thread https://github.com/notifications/unsubscribe-auth/AKjEpIS41ToliPFvhe97xNJppuGM5jBkks5qo_stgaJpZM4J6AGr .

danionita commented 7 years ago

This is now broken again.

Desired behavior: if the valuation of a value exchange is changed, the valuation should immediately propagate to both its ports. If the valuation of a port is changed, it only applies to that port.

Current behavior: when pressing the fraud generation or profitability computation button, the valuation of value exchanges are propagate its ports, but the RDF that is generated does not include this. Also, only numerical formulas are propagated, not expressions.

bobismijnnaam commented 7 years ago

I found how I (incorrectly) implemented it:

[in RDFExport.java]
// Propagate valuation from edge if vp valuation == 0
if (value.formulas.getOrDefault("VALUATION", "0").equals("0")) {
    value.formulas.put("VALUATION", veInfo.formulas.getOrDefault("VALUATION", "0"));
    res.addProperty(E3value.e3_has_formula, "VALUATION" + "=" + value.formulas.get("VALUATION"));
}

So when a value port's valuation is zero, it copies the valuation from its connected value transfer. This should not edit the original model (the one in the editor), so that's a bug. But the semantics are different from the previously described desired behaviour (apply as soon as the valuation on a value transfer is changed). I'll implement the desired behavior now, but if you want the other way it's easy to revert.

bobismijnnaam commented 7 years ago

Implemented as of d2b17d595021cb65d0a741f44d80524d34aac2c3.

bobismijnnaam commented 7 years ago

Does this fix the issue @danionita?

danionita commented 7 years ago

Yes, seems to work now. However, we need to trigger this when loading the example models too. Right now, fraud generation for flat-rate does not work because this does not take place.

bobismijnnaam commented 7 years ago

I'm on it :p

On 10 October 2016 at 14:26, danionita notifications@github.com wrote:

Yes, seems to work now. However, we need to trigger this when loading the example models too. Right now, fraud generation for flat-rate does not work because this does not take place.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/danionita/e3tools/issues/60#issuecomment-252604100, or mute the thread https://github.com/notifications/unsubscribe-auth/AC8IaMee4NljkP73MBsvgJh5O9Hp-40Aks5qyi76gaJpZM4J6AGr .