@@ -45,7 +45,7 @@ export default class BindingSimulator implements IClientSimulatorImpl {
4545 agents : InputAgent [ ] ,
4646 size : number ,
4747 initPositions : InitialCondition = InitialCondition . SORTED ,
48- timeFactor : number = LiveSimulationData . DEFAULT_TIME_FACTOR
48+ timeFactor : number = LiveSimulationData . DEFAULT_TIME_FACTOR ,
4949 ) {
5050 this . size = size ;
5151 this . productColor = new Map ( ) ;
@@ -92,7 +92,7 @@ export default class BindingSimulator implements IClientSimulatorImpl {
9292
9393 private getProductIdByAgents (
9494 agent1 : BindingInstance | InputAgent ,
95- agent2 : BindingInstance | InputAgent
95+ agent2 : BindingInstance | InputAgent ,
9696 ) {
9797 if ( agent1 . id > agent2 . id ) {
9898 return `${ agent1 . id } #${ agent2 . id } ` ;
@@ -111,7 +111,7 @@ export default class BindingSimulator implements IClientSimulatorImpl {
111111 const color2 = this . productColor . get ( partnerId ) ;
112112 if ( color1 && color2 ) {
113113 throw new Error (
114- `Both agents (${ id } and ${ partnerId } ) have a product color defined. Only one should have a product color.`
114+ `Both agents (${ id } and ${ partnerId } ) have a product color defined. Only one should have a product color.` ,
115115 ) ;
116116 }
117117 return color2 || color1 || "" ;
@@ -139,7 +139,7 @@ export default class BindingSimulator implements IClientSimulatorImpl {
139139
140140 private initializeAgents (
141141 agents : InputAgent [ ] ,
142- initPositions : InitialCondition = InitialCondition . SORTED
142+ initPositions : InitialCondition = InitialCondition . SORTED ,
143143 ) : StoredAgent [ ] {
144144 for ( let i = 0 ; i < agents . length ; ++ i ) {
145145 const agent = agents [ i ] as StoredAgent ; // count is no longer optional
@@ -148,7 +148,7 @@ export default class BindingSimulator implements IClientSimulatorImpl {
148148 // the count will already be set
149149 if ( agent . count === undefined ) {
150150 agent . count = this . convertConcentrationToCount (
151- agent . initialConcentration
151+ agent . initialConcentration ,
152152 ) ;
153153 }
154154 if ( agent . complexColor ) {
@@ -167,14 +167,14 @@ export default class BindingSimulator implements IClientSimulatorImpl {
167167 }
168168 const circle = new Circle (
169169 new Vector ( ...position ) ,
170- agent . radius
170+ agent . radius ,
171171 ) ;
172172 const instance = new BindingInstance (
173173 circle ,
174174 agent . id ,
175175 agent . partners ,
176176 agent . kOn ,
177- agent . kOff
177+ agent . kOff ,
178178 ) ;
179179 this . system . insert ( instance ) ;
180180 this . instances . push ( instance ) ;
@@ -196,7 +196,7 @@ export default class BindingSimulator implements IClientSimulatorImpl {
196196 this . system . createLine (
197197 new Vector ( point [ 0 ] , point [ 1 ] ) ,
198198 new Vector ( nextPoint [ 0 ] , nextPoint [ 1 ] ) ,
199- { isStatic : true }
199+ { isStatic : true } ,
200200 ) ;
201201 } ) ;
202202 }
@@ -274,7 +274,7 @@ export default class BindingSimulator implements IClientSimulatorImpl {
274274 public changeConcentration (
275275 agentId : number ,
276276 newConcentration : number ,
277- initPositions : InitialCondition
277+ initPositions : InitialCondition ,
278278 ) {
279279 const agent = find ( this . agents , ( agent ) => agent . id === agentId ) ;
280280 if ( ! agent ) {
@@ -305,21 +305,21 @@ export default class BindingSimulator implements IClientSimulatorImpl {
305305
306306 const circle = new Circle (
307307 new Vector ( ...position ) ,
308- agent . radius
308+ agent . radius ,
309309 ) ;
310310 const instance = new BindingInstance (
311311 circle ,
312312 agent . id ,
313313 agent . partners ,
314314 agent . kOn ,
315- agent . kOff
315+ agent . kOff ,
316316 ) ;
317317 this . system . insert ( instance ) ;
318318 this . instances . push ( instance ) ;
319319 }
320320 } else if ( diff < 0 ) {
321321 const toRemove = this . instances . filter (
322- ( instance ) => instance . id === agentId
322+ ( instance ) => instance . id === agentId ,
323323 ) ;
324324 for ( let i = 0 ; i < Math . abs ( diff ) ; ++ i ) {
325325 const instance = toRemove [ i ] ;
@@ -349,14 +349,14 @@ export default class BindingSimulator implements IClientSimulatorImpl {
349349 const init = < { [ key : string ] : number } > { } ;
350350 const concentrations = this . agents . reduce ( ( acc , agent ) => {
351351 acc [ agent . name ] = this . convertCountToConcentration (
352- agent . count - this . currentComplexMap . get ( agent . id . toString ( ) ) !
352+ agent . count - this . currentComplexMap . get ( agent . id . toString ( ) ) ! ,
353353 ) ;
354354 return acc ;
355355 } , init ) ;
356356 const productId = this . getProductIdByProductName ( product ) ;
357357 if ( productId ) {
358358 concentrations [ product ] = this . convertCountToConcentration (
359- this . currentComplexMap . get ( productId ) || 0
359+ this . currentComplexMap . get ( productId ) || 0 ,
360360 ) ;
361361 }
362362 return concentrations ;
@@ -391,7 +391,7 @@ export default class BindingSimulator implements IClientSimulatorImpl {
391391 for ( let i = 0 ; i < this . instances . length ; ++ i ) {
392392 const releasedChild = this . instances [ i ] . oneStep (
393393 this . size ,
394- this . timeFactor
394+ this . timeFactor ,
395395 ) ;
396396 if ( releasedChild ) {
397397 this . currentNumberOfUnbindingEvents ++ ;
@@ -412,10 +412,10 @@ export default class BindingSimulator implements IClientSimulatorImpl {
412412 const childPosition = instance . pos ;
413413 const distanceVector = new Vector (
414414 childPosition . x - parentPosition . x ,
415- childPosition . y - parentPosition . y
415+ childPosition . y - parentPosition . y ,
416416 ) ;
417417 const distance = Math . sqrt (
418- distanceVector . x ** 2 + distanceVector . y ** 2
418+ distanceVector . x ** 2 + distanceVector . y ** 2 ,
419419 ) ;
420420 const perfectBoundDistance =
421421 instance . parent . r + instance . r - bindingOverlap ;
@@ -433,12 +433,12 @@ export default class BindingSimulator implements IClientSimulatorImpl {
433433 private incrementBoundCounts (
434434 a : BindingInstance ,
435435 b : BindingInstance ,
436- amount : number
436+ amount : number ,
437437 ) {
438438 const complexName = this . getProductIdByAgents ( a , b ) ;
439439 this . currentComplexMap . set (
440440 complexName ,
441- ( this . currentComplexMap . get ( complexName ) || 0 ) + amount
441+ ( this . currentComplexMap . get ( complexName ) || 0 ) + amount ,
442442 ) ;
443443
444444 const previousValueA = this . currentComplexMap . get ( a . id . toString ( ) ) || 0 ;
0 commit comments