close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 20 years ago

Closed 20 years ago

Last modified 18 years ago

#191 closed defect (fixed)

Problems between BTsrFromReal and other Series

Reported by: danirus Owned by: danirus
Priority: normal Milestone:
Component: TimeSetAlgebra Version: head
Severity: normal Keywords:
Cc:

Description

With code like this:

_
Serie ser1 = 5 * CalVar(Diario, Monthly);

or

Serie ser2 = 5 * Pulse(y2004m01, Weekly);


Tol presents some problems.
In those two examples Tol creates two BTsrFromReal series. In both cases, "5"
constant is a BTsrFromReal Serie, which has a Dating == C (or Daily), since bug
177 was resolved.

When we make a product between a BTsrFromReal (with Dating==C) and other
Serie of any other Dating (for example Monthly), Tol can not set a correct Dating
for the result.

Change History (3)

comment:1 Changed 20 years ago by danirus

Status: newassigned

comment:2 Changed 20 years ago by danirus

Resolution: fixed
Status: assignedclosed

This bug has been resolved and fixed.
Now you can try:


Real a = 2; Real b = 4;
Serie ser1 = (-a) * Pulse(y2004m01, Weekly);
Serie ser2 = a * CalVar(Diario, Monthly);
Serie ser3 = -a;
Serie ser4 = b;
Serie serProd = Prod(ser2,ser3, ser4);


It works.

The problem was related with dating_ attribute of BTsrFromReal. I just implement a
solution based on a new attribute for class BTimeSerie. This new attribute, called
datingType_ can has two values: FIXED or VOLATILE. When Tol operates with
something like:

Serie minus5 = -5;


A BTsrReal is created with a Daily dating_. Then a BTsrMinus, which inherit the
same dating_ attribute. After that, when we do:

Serie ser1 = minus5 * CalVar(Diario, Monthly);


Tol created a new Serie called "CalVar(Diario, Monthly)" with a Monthly dating_.
The it tries to do the product, but there is a problem of incompatible datings.

Using a VOLATILE dating_, Tol can choose the correct dating between one FIXED
and one or more VOLATILEs. All those operations are done inside a BSerieGroup
object.

comment:3 Changed 18 years ago by Víctor de Buen Remiro

bug_file_loc: http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000173
dependson: 173
Note: See TracTickets for help on using tickets.