How to run the same sequence on two different sequencers and having same values after randomization? - uvm

I want to run the same sequence on two different sequencers but the problem I am facing is randomisation is done after the sequence is started. So I am getting different sequence items. I want to have the same sequence items after the randomization. I am not getting what should I do?

Related

How to model time-schedules of a public transport system in a graph database?

Suppose I want to model a public bus transport service with a graph database such as Neo4j.
Such service is constituted by a set bus stops, a set of lines and a set of time-schedules which relates lines with bus-stops.
Querying the database should answer questions such as what is the best route (for example by time or by walking the least possible or with the less number of changes) to go from a point of the city to another.
Following the most common guidelines bus-stops and lines become nodes each one having proper properties (ID's, geoposition and address for each stop and so on).
Each line has edges with labels start and stop the beginning and ending of a line service. Subsequent bus-stops are connected with other edges with some properties (such as the line(s), the distance between the two stops and others).
How to model time-schedules in such databases? Is it good to model them as a key-value property of the bus stops (or the edges connecting them) whose value is an array containing the the times?
Sounds like your main concern is how to model schedule-times for each line. If I understand your concern correctly, it's because each line can have multiple shifts a day between two bus stops.
It's doable to put all schedule-times in an array and store it as a property of bus stops. However, it would be quite hard to extend to other transportation choices other than buses. So in a more scalable graph model, the vertex could be a place, and the edge would be the transportation (not limited to bus) between two places. Any attribute of a transportation choice can be a property of the edge, including time schedules.
But let's take bus as an example. So suppose you have m lines between the same two bus stops, A and B, and for each line you want to schedule n shifts per day (in reality n can be different for different lines but that doesn't matter that much). Then you can create m*n edges between A and B. In this case, each edge has only one attribute as its scheduled time. Then you can use rankings to differentiate the edges. An alternative is to create just m edges and define the n shifts as properties on each edge. In this case you have n attributes for each edge as its scheduled times. Obviously the former way is friendlier to later queries.

Can a B tree have more solutions?

I have this values
10,15,20,25,30,33,38,40,43,45,50
and then I insert 34
I tried 2 generators
https://s3.amazonaws.com/learneroo/visual-algorithms/BTree.html
http://ysangkok.github.io/js-clrs-btree/btree.html
and they gave me different results
On paper I tried to create the tree inserting those consecutive values 1 by1 and get a totally different result.
If the elements were in random order would the result be the same?
My result is this
The problem is when on the right I have 38|40|45 and I add 50 I have to put 40 a level higher but in the internet generators they also put 33 a level down and I don't see why
Can a B tree have more solutions?
I think you're asking whether there can be more than one one way to store a given set of keys in a b-tree, but you have already answered that yourself. Both of the generated examples you present contain the same keys and are valid 1-3 b-trees. The first is also a valid 1-2 b-tree. With the correction, your attempt is also a valid 1-3 b-tree.
Note well that there are different flavors of b-tree, based on how many keys the internal nodes are permitted to contain, and also that even binary trees, with which you may be more familiar, afford many different structures for the same set of two or more keys.
If the elements were in random order would the result be the same?
Very likely so, yes, but that's not a question of the b-tree form and structure, but rather about the implementation of the software used to construct and maintain it.
You seem confused that
in the internet generators they also put 33 a level down and I don't see why
, but we can only speculate about the implementation of the software supporting those trees. It's unlikely that anyone here can tell you with certainty why they produce the particular b-tree forms they do, but those forms are valid, and so, now, is yours.

Data Visualization using react

I guess react can do what i want. I have a problem statement in which I need to visualize data obtained from processes. The data that needs to be visualized needs some pre-processing. I need to visualize multiple sequences with each sequence having multiple processes in it. Each process varies in time duration, which have to be represented in form of array of varying length. Also in order to manage 1000's of sequences I need to do some clustering and represent fewer sequences that fits on single page. I am looking to find the best suited framework in JS to achieve this. Can anyone please guide me.

How can I reset my number generator?

I needed a way to generate unique sequences of numbers so I followed the following simple approach that works fine:
I used a table that has the next value for each sequence.
I get the value increment it by one, store it and use it in my application code.
Problem: I don't know how can I reset this generator.
As an example assume that a part of the program runs and in a loop and at the beginning of a loop the sequence is 102012 and after the loop it is 1045000.
Let's say that my program finishes and then for some reason I need to reset the sequence back to 102012 so that if the program runs again it can generate the same sequence.
The only thing I could think of is to store in a table dates with the sequence at that point.
But my concern is that I would end up with a big table that would have more information than needed.
I was wondering is there a better approach for this? I assume this problem is not rare.
According to your description, you have a table - I'll call it 'counter' - with one field in it, which I'll call 'current'. In order to reset the value, you have to use an update query
update counter
set current = 102012
I have concerns about your use of this table, but as you didn't ask about referential integrity and other such topics, I won't comment.
for some reason I need to reset the sequence
What reason? And why did you start using a sequence in the first place?
Consider this:
If multiple instances of your application are concurrently accessing the database, resetting the sequence pretty much defeats its purpose. If it doesn't, then you probably didn't need a sequence in the first place.
If only one application instance is accessing the database, then you could have generated the numbers directly in the application code, and restarted the generation at will there.
My point is that if you are using the sequence the way it was meant to be used, you shouldn't normally need to reset it. So my guess would be that you probably need something else, not a sequence. The answers to the questions above would help indicate what.
That being said, there are DBMS-specific ways to reset a sequence, usually through ALTER SEQUENCE. What is your DBMS?

How to display all records in one page in crystal reports while using multiple detail section?

In this below image i design a crystal report
the records are printing in eight pages.i have three details section one detail section i inserted sub report.anther two detail sections i inserted two different formats
i have written one store procedure as below.
out put is
i am not getting any idea solve this problem
please help me
Actually my problem is i have three tests in my project.i have to print three tests in three different pages with different formats In first test i have eight results i have to show eight results in one page.is there any solution give reply
You have to do grouping for all the detail section. And While grouping click on the keep group together.
Thus your problem is solved

Resources