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 16 years ago

Closed 16 years ago

#612 closed defect (invalid)

Include of a bdt works with global scope in a NameBlock instead of local scope

Reported by: César Pérez Álvarez Owned by: Víctor de Buen Remiro
Priority: high Milestone:
Component: TimeSetAlgebra Version: head
Severity: trivial Keywords: GlobalizeSeries
Cc:

Description

If you try a code like this:

NameBlock a = Set data = Include("file.bdt") ?;
NameBlock b = Set data = Include("file.bdt") ?;

It does not work becouse there is an error of global series in file.bdt.

If you try this

NameBlock c = { Set data = Include("file.bdt") ?};
NameBlock d = { Set data = Include("file.bdt") ?};

It does not work too.

I will expect work this way:

If we have two series with same name (example "Serie1") and different bdt a would like to do this:
NameBlock a = Set data = Include("file1.bdt") ?;
NameBlock b = Set data = Include("file2.bdt") ?;

Serie sera = a::data::Serie1;
Serie sera = b::data::Serie1;

This is very useful when you have differents magnitudes for the same topic (for example magnitudes for geographical info).

Change History (2)

comment:1 in reply to:  description Changed 16 years ago by César Pérez Álvarez

Replying to cperez:

If you try a code like this:

NameBlock a = Set data = Include("file.bdt") ?;
NameBlock b = Set data = Include("file.bdt") ?;

It does not work becouse there is an error of global series in file.bdt.

If you try this

NameBlock c = { Set data = Include("file.bdt") ?};
NameBlock d = { Set data = Include("file.bdt") ?};

It does not work too.

I will expect work this way:

If we have two series with same name (example "Serie1") and different bdt a would like to do this:
NameBlock a = Set data = Include("file1.bdt") ?;
NameBlock b = Set data = Include("file2.bdt") ?;

Serie sera = a::data::Serie1;
Serie sera = b::data::Serie1;

This is very useful when you have differents magnitudes for the same topic (for example magnitudes for geographical info).

I think that problem was variable Real GlobalizeSeries. If you put Real GlobalizeSeries:=1, the thing runs what you expect. We must think in disable this behaviour in the future, must not we?

comment:2 Changed 16 years ago by Víctor de Buen Remiro

Keywords: GlobalizeSeries added; NameBlock removed
Resolution: invalid
Severity: majortrivial
Status: newclosed

At first, this problem has no relation with NameBlock : this code is equivalent

  Set c = {[[ Set data = Include("file.bdt") ]]};
  Set d = {[[ Set data = Include("file.bdt") ]]};

When database queries were added to TOL, people ask for returning global objects in order to write more easy TOL code. Afterwords, they ask for BDT including global objects in the same way. Development team never was agree with this behaviour and Real GlobalizeSeries was created to allow disable it.

We don't know what people expects, somebody expects global series, other one expects local ones that is the historical behaviour and so the current default. To disable globalization of series you must set

  Real GlobalizeSeries := 0;

A test has been added to standard tol test battery at
https://www.tol-project.org/browser/tolp/trunk/tol_tests/tol/Bugzilla/bug_000612/test.tol

Sorry, but I think this is no bug here.

Thanks for reporting.

Note: See TracTickets for help on using tickets.