#NEWLINE# @ with_model #NEWLINE# def test_kappa_simulation_results( ) : #NEWLINE# #INDENT# Monomer ( 'A' , [ 'b' ] ) #NEWLINE# Monomer ( 'B' , [ 'b' ] ) #NEWLINE# Initial ( A ( b = None ) , Parameter ( 'A_0' , 100 ) ) #NEWLINE# Initial ( B ( b = None ) , Parameter ( 'B_0' , 100 ) ) #NEWLINE# Rule ( 'A_binds_B' , ( ( A ( b = None ) + B ( b = None ) ) >> ( A ( b = 1 ) % B ( b = 1 ) ) ) , Parameter ( 'kf' , 1 ) ) #NEWLINE# Rule ( 'A_binds_B_rev' , ( ( A ( b = 1 ) % B ( b = 1 ) ) >> ( A ( b = None ) + B ( b = None ) ) ) , Parameter ( 'kr' , 1 ) ) #NEWLINE# Observable ( 'AB' , ( A ( b = 1 ) % B ( b = 1 ) ) ) #NEWLINE# npts = 200 #NEWLINE# kres = run_simulation ( model , time = 100 , points = npts ) #NEWLINE# ok_ ( ( len ( kres [ 'time' ] ) == ( kres + 1 ) ) ) #NEWLINE# ok_ ( ( len ( kres [ 'AB' ] ) == ( npts + 1 ) ) ) #NEWLINE# ok_ ( ( kres [ 'time' ] [ 0 ] == 0 ) ) #NEWLINE# ok_ ( ( sorted ( kres [ 'time' ] ) [ ( - 1 ) ] == 100 ) )