<commit_before>"
A KETauLeapSimulator improves the Gillespie's direct method by using the TauLeap algorithm - An algorithm in which the number of time for an event occurs is a Poisson distribution

"
Class {
	#name : #KETauLeapSimulator,
	#superclass : #KEStochasticSimulator,
	#instVars : [
		'proportionalSelectionClass'
	],
	#category : #'Kendrick-Core-Simulations'
}

{ #category : #'as yet unclassified' }
KETauLeapSimulator >> doTauLeapIteration [
	
	model transitions do: [ :tr|
		|rate numPoisson prob|
		"model parameters at: #scope put: tr scope.
		model parameters at: #contactingSource put: (tr from)."
		((tr from at: #status) = #empty)
		ifTrue: [ model currentCompartment: (tr to) ] 
		ifFalse: [ model currentCompartment: (tr from) ].
		model nextCompartment: (tr to).
		prob := (tr probability value: model) abs.
		"prob isDictionary ifTrue: [ prob := prob values sum ]."
		rate := prob * (model atCompartment: tr from).
		numPoisson := (PMPoissonGenerator lambda: (rate * step)) next.
		tr executeOn: model times: numPoisson   
		 ].
	
]

{ #category : #'as yet unclassified' }<commit_msg>Refactoring of the Tauleap algorithm by making it less dependent on the compartment and adding stochasticity<commit_after>"
A KETauLeapSimulator improves the Gillespie's direct method by using the TauLeap algorithm - An algorithm in which the number of time for an event occurs is a Poisson distribution

"
Class {
	#name : #KETauLeapSimulator,
	#superclass : #KEStochasticSimulator,
	#instVars : [
		'proportionalSelectionClass'
	],
	#category : #'Kendrick-Core-Simulations'
}

{ #category : #'as yet unclassified' }
KETauLeapSimulator >> doTauLeapIteration [
	
	model transitions do: [ :tr|
		|rate numPoisson prob|
		
		prob := (tr probability value: model) abs.
		rate := prob * (model atCompartment: tr from) atRandom.
		numPoisson := (PMPoissonGenerator lambda: (rate * step)) next.
		tr executeOn: model times: numPoisson   
		 ].
	
]

{ #category : #'as yet unclassified' }
{'fraction_non_alphanumeric': 0.10412474849094568, 'fraction_numerical': 0.0, 'mean_word_length': 4.375675675675676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2636857', 'n_tokens_mistral': 690, 'n_tokens_neox': 639, 'n_words': 212}