FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
firefront/src/Simulator.cpp at master · OroraTech/firefront · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
OroraTech
/
firefront
Public
forked from
forefireAPI/forefire
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
firefront
/
src
/
Simulator.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (46 loc) · 1.38 KB
Breadcrumbs
firefront
/
src
/
Simulator.cpp
Copy path
File metadata and controls
63 lines (46 loc) · 1.38 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
*
* @file Simulator.cpp
* @brief TODO: add a brief description.
* @copyright Copyright (C) 2025 ForeFire, Fire Team, SPE, CNRS/Universita di Corsica.
* @license This program is free software; See LICENSE file for details. (See LICENSE file).
* @author Jean‑Baptiste Filippi — 2025
*/
#
include
"
Simulator.h
"
namespace
libforefire
{
Simulator::Simulator
() {
outputs =
false
;
}
Simulator::Simulator
(TimeTable* tt,
bool
outs) : schedule(tt) {
outputs = outs;
}
Simulator::~Simulator
() {
schedule->
clear
();
}
void
Simulator::setTimeTable
(TimeTable* tt){
schedule = tt;
}
TimeTable*
Simulator::getSchedule
(){
return
schedule;
}
void
Simulator::goTo
(
const
double
& endTime){
while
( schedule->
getTime
() <= endTime +
EPSILONT
) {
FFEvent* upEvent = schedule->
getUpcomingEvent
();
if
( !upEvent ){
cout <<
"
no more events !!
"
<<endl;
return
;
}
//
Treating the desired actions on the Atom
//
Possible inputs
if
( upEvent->
input
) upEvent->
getAtom
()->
input
();
//
Update the event, i.e. update the properties
upEvent->
getAtom
()->
update
();
//
Advance the event in time, i.e. calculate new properties at next time
upEvent->
getAtom
()->
timeAdvance
();
//
Possible outputs
if
( upEvent->
output
) upEvent->
getAtom
()->
output
();
//
Re-locate the event in the schedule
upEvent->
setNewTime
(upEvent->
getAtom
()->
getUpdateTime
());
schedule->
insert
(upEvent);
}
}
}
Back
|
FazBrowse Home
|
New Git URL