InitalCommit

This commit is contained in:
WyanMueller
2025-11-16 10:30:26 +01:00
parent 8b0b73bba8
commit d2e409d10f
73 changed files with 3209 additions and 0 deletions
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BaseCellSimulation.Enzyms.Cytosol.Ribosomen
{
public class AminoacylTRNASynthetase : InternalEnzym
{
public AminoacylTRNASynthetase()
{
Km = 0.1;
Vmax = 1.5;
}
public override void ApplyChanges(CellRessources res, double dt)
{
double dAAtRNA = Math.Min(rate * dt, Math.Min(res.Res.Protein.AminoAcids, res.Res.Protein.tRNA));
dAAtRNA = Math.Min(dAAtRNA, res.Res.Energy.ATP);
res.Res.Protein.AminoAcids -= dAAtRNA;
res.Res.Protein.tRNA -= dAAtRNA;
res.Res.Protein.Aminoacyl_tRNA += dAAtRNA;
res.ConsumeATP(dAAtRNA);
}
public override void ComputeRate(Resources res)
{
Michaelis_Menten(res.Protein.tRNA);
}
}
}
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BaseCellSimulation.Enzyms.Cytosol.Ribosomen
{
public class PeptidylTransferase : InternalEnzym
{
public PeptidylTransferase()
{
Km = 0.05;
Vmax = 5.0;
}
public override void ApplyChanges(CellRessources res, double dt)
{
double dPeptide = Math.Min(rate * dt, Math.Min(res.Res.Protein.Aminoacyl_tRNA, res.Res.Energy.GTP));
res.Res.Protein.Aminoacyl_tRNA -= dPeptide;
res.Res.Protein.FunctionalProteins += dPeptide;
res.Res.Energy.GTP -= dPeptide;
}
public override void ComputeRate(Resources res)
{
Michaelis_Menten(res.Protein.Aminoacyl_tRNA);
}
}
}
@@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BaseCellSimulation.Enzyms.Cytosol.Ribosomen
{
public class Ribosome : InternalEnzym
{
private TranslationFactor initiation;
private TranslationFactor elongation;
private TranslationFactor termination;
private const double ProteinPermRNA = 20.0;
int ribosomenState = 0;
public Ribosome()
{
Km = 0.5; // fiktiv (abhängig von mRNA)
Vmax = 10.0; // z. B. 10 Aminosäuren pro Sekunde
initiation = new TranslationFactor(TranslationFactor.FactorType.Initiation);
elongation = new TranslationFactor(TranslationFactor.FactorType.Elongation);
termination = new TranslationFactor(TranslationFactor.FactorType.Termination);
}
private double availableAA = 0;
private double dProtein = 0;
public override void ApplyChanges(CellRessources res, double dt)
{
int safety = 0;
while (safety++ < 10)
{
switch (ribosomenState)
{
case 0:
availableAA = res.Res.Protein.AminoAcids;
dProtein = rate * dt;
// Translation start -> Initiationsfaktoren verbrauchen GTP
initiation.ApplyChanges(res, dt * 0.5);
if (initiation.TranslationSpeed > 0)
{
dProtein = Math.Min(initiation.TranslationSpeed, dProtein);
dProtein = Math.Min(dProtein, Math.Min(res.Res.Protein.mRNA, availableAA));
res.Res.Protein.AminoAcids -= dProtein;
res.Res.Protein.FunctionalProteins += dProtein;
ribosomenState = 1;
}
else return;
break;
case 1:
elongation.ApplyChanges(res, dt * dProtein * 0.1);
if (elongation.TranslationSpeed > 0)
{
dProtein = Math.Min(elongation.TranslationSpeed, dProtein);
// mRNA-Abnutzung: jede mRNA kann nur begrenzt oft benutzt werden
double used_mRNA = dProtein / ProteinPermRNA;
res.Res.Protein.mRNA -= used_mRNA;
// Abbauprodukte: ein Teil recycelt, ein Teil wird zu Waste
double degraded = used_mRNA * 0.8;
double lost = used_mRNA * 0.2;
res.Res.Protein.Nucleotides += degraded; // Rückgewinn von Basen
res.Res.Protein.Waste += lost; // Restliche RNA-Fragmente als Zellabfall
ribosomenState = 2;
}
else return;
break;
case 2:
termination.ApplyChanges(res, dt * 0.01 * dProtein);
if (termination.TranslationSpeed > 0)
{
res.ConsumeATP(dProtein * 4); // z. B. 4 ATP pro Peptidbindung -> ADP
ribosomenState = 0;
}
else return;
break;
}
}
}
public override void ComputeRate(Resources res)
{
if (ribosomenState == 0) {
if (res.Protein.AminoAcids <= 0.0 || res.Protein.mRNA <= 0.0)
return;
double availablemRNA = res.Protein.mRNA;
Michaelis_Menten(availablemRNA);
initiation.ComputeRate(res);
elongation.ComputeRate(res);
termination.ComputeRate(res);
}
}
}
}
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BaseCellSimulation.Enzyms.Cytosol.Ribosomen
{
/*
* Faktor Aufgabe Energieverbrauch
* IF (Initiation Factors) Ribosom startet Translation 1 GTP
* EF-Tu, EF-G (Elongation) tRNA Positionierung, Translokation 1–2 GTP pro Zyklus
* RF (Release Factors) Beendet Translation an Stoppcodon 1 GTP
*/
internal class TranslationFactor : InternalEnzym
{
public enum FactorType { Initiation, Elongation, Termination }
public FactorType Type { get; }
public double TranslationSpeed;
public TranslationFactor(FactorType type)
{
Type = type;
Km = 0.1;
Vmax = 2.0;
}
public override void ComputeRate(Resources res)
{
Michaelis_Menten(res.Energy.GTP);
}
public override void ApplyChanges(CellRessources res, double dt)
{
double used = Math.Min(rate * dt, res.Res.Energy.GTP);
res.Res.Energy.GTP -= used;
res.Res.Energy.GDP += used;
TranslationSpeed = used;
}
}
}