Randomization behaviour when doing shallow copy

I have a question regarding randomization, when an object is created as a shallow copy of another object. In the following code, b2 is created as a shallow copy of b1 and when repeatedly randomized, it produces same values, but instead if b2 is just new’d instead of shallow copy, different values are produced when randomized.

 
class A; 
rand bit [7:0] i; 
endclass 

program main; 
initial 
begin 
static int i = 0;
A b1; 
A b2; 
b1 = new(); 
$display( b1.i ); 
//b1.a = new(); 
b1.randomize();
$display( b1.i ); 
//$display( b2.a.i );
repeat(5)
begin
b2 = new b1;
$display("\nBefore Randomization");
$display( b1.i ); 
$display( b2.i ); 
$display("\nAfter Randomization");
b2.randomize();
$display( b1.i ); 
$display( b2.i ); 
i++;
end
end 
endprogram

Sample output :

0

102

Before Randomization

102

102

After Randomization

102

19

Before Randomization

102

102

After Randomization

102

19

Before Randomization

102

102

After Randomization

102

19

Before Randomization

102

102

After Randomization

102

19

Before Randomization

102

102

After Randomization

102

19

I am looking for an explanation for this kind of randomization behavior.
P.S. : Simulator : Questasim 10.3a_1

In reply to sharat:

On further debug,I found out that during a shallow copy the randomization state also gets copied over and hence this behavior. So, what governs the randomization state and whether the interpretation is correct?

In reply to sharat:

create b2 object outside the loop,you will get the different randomized values!!

Thanks,
sagar

See Section 8.12 Assignment, renaming, and copying in the Class Chapter of the 1800-2012 LRM.