This is c# implementation of CSL++ language, used for modeling of discrete event simulation systems, based on concept of action choice.

Project Activity

See All Activity >

Follow CSL CS

CSL CS Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Ratings

★★★★★
★★★★
★★★
★★
1
0
0
0
2
ease 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 1 / 5
features 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 1 / 5
design 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 1 / 5
support 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 1 / 5

User Reviews

  • Dzięki tej bibliotece laptop mi lata w trybie samolotowym
  • using System; using System.Collections.Generic; using System.Linq; using System.Text; using CSL; using CSL.Time; using CSL.Groups; using CSL.Generators.Discrete; using CSL.Statistics; using System.Diagnostics;namespace CSLProjects { class ExampleB { Element[] zgloszenie; uint HI; uint LO; PureGroup.PBoolDelegate function; public void Run() { uint maxLiczbaZgloszen = 1000; uint srOdstepZglHI = 1000; uint srOdstepZglLO = 3000; uint srCzasObsl = 500; uint sumZgloszen = 1000; HI = 1; LO = 0; zgloszenie = new Element[maxLiczbaZgloszen]; for (uint i = 0; i < maxLiczbaZgloszen; i++) { zgloszenie[i] = new Element(); } SetGroup wolne = new SetGroup(maxLiczbaZgloszen); QueueGroup kolejka = new QueueGroup(maxLiczbaZgloszen); Timer NadZglHI = new Timer();Timer NadZglLO = new Timer(); Timer KonObsl = new Timer(); int stanObsl = -1; NegExp genOdstZglHI = new NegExp(srOdstepZglHI); NegExp genOdstZglLO = new NegExp(srOdstepZglLO); NegExp genCzasObsl = new NegExp(srCzasObsl); StatD statCzasuPobytuLO = new StatD(); StatCRect statDKol = new StatCRect(); uint dlKol; Timer zegarStat = new Timer(); Hist histCzasuPobytuHI = new Hist(15, 0, 1000); Hist histCzasuPobytuLO = new Hist(15, 0, 1000); long LiczbaObs = 0; long SumLiczbaObs = 10000; uint El = uint.MaxValue; wolne.Load(); kolejka.Zero(); zegarStat.T = 0; dlKol = 0; statDKol.Clear(); histCzasuPobytuHI.Clear();histCzasuPobytuLO.Clear(); NadZglHI.t = 0; NadZglHI.SetOn(); NadZglLO.t = genOdstZglLO.Get(); NadZglLO.SetOn(); function = bIsHI; while (true) { if (NadZglLO.Now()) { // wyszukiwanie pierwszego wolnego elementu wolne.Find(ref El, FindParameters.FIRST); wolne.From(El); zgloszenie[El].t = 0; zgloszenie[El].nPri = LO; //wpisanie informacji o nowym elemencie w kolejce kolejka.To(El); dlKol++; statDKol.Add(dlKol, -zegarStat.t); NadZglLO.t = genOdstZglLO.Get(); // ustawienie czasu do pojawienia sie kolejnego elementu } if (NadZglHI.Now()) { // wyszukiwanie pierwszego wolnego elementu wolne.Find(ref El, FindParameters.FIRST);wolne.From(El); zgloszenie[El].t = 0; zgloszenie[El].nPri = HI; //wpisanie informacji o nowym elemencie w kolejce kolejka.To(El); dlKol++; statDKol.Add(dlKol, -zegarStat.t); NadZglHI.t = genOdstZglHI.Get(); // ustawienie czasu do pojawienia sie kolejnego elementu } // Sprawdzenie, czy konieczna jest obsluga zdarzenia konca obslugi if (KonObsl.Now()) { if (zgloszenie[stanObsl].nPri == LO) { statCzasuPobytuLO.Add(-zgloszenie[stanObsl].t); } else { histCzasuPobytuHI.Add(-zgloszenie[stanObsl].t); } LiczbaObs++; wolne.To((uint)stanObsl); stanObsl = -1; KonObsl.SetOff(); } if (stanObsl == -1 && dlKol > 0){ // wyszukanie elementu o wysokim piorytecie if (!kolejka.Find(ref El, FindParameters.FIRST, function)) { // gdy brak zgloszenia o wysokim to pobieramy pierwsze oczekujace kolejka.Find(ref El, FindParameters.FIRST); } kolejka.From(El); stanObsl = (int)El; --dlKol; // zmiejszenie rozmiaru kolejki statDKol.Add(dlKol, -zegarStat.t); KonObsl.t = genCzasObsl.Get(); // ustawienie czasu obslugi kolejnego zgloszenia KonObsl.SetOn(); } if (LiczbaObs >= SumLiczbaObs) { break; } LiczbaObs++; Time.TimeFlow(); Console.WriteLine("Czas symulacji: " + -zegarStat.t); } double srednia; srednia = 3.14; Console.WriteLine("Wyniki po przejsciu " + LiczbaObs + " obserwacji"); Console.WriteLine("Czas symulacji: " + -zegarStat.t);statDKol.GetStat(ref srednia, -zegarStat.t); //zmiana Console.WriteLine("Srednia dlugosc kolejki LO: " + srednia); statCzasuPobytuLO.GetStat(ref srednia); //zmiana Console.WriteLine("Sredni czas pobytu zgloszen: " + srednia); Console.WriteLine("Histogram czasu pobytu zgłoszeń HI:"); Console.WriteLine(histCzasuPobytuHI.Out()); string histogram = histCzasuPobytuHI.Out(); Console.ReadKey(); } class Element : Timer { public uint nPri; } bool bIsHI(uint i) { return (zgloszenie[i].nPri == HI); } } }
  • :(
Read more reviews >

Additional Project Details

Registered

2012-12-03