24 static char* source_type[] = {
25 "sys.power.battery",
"sys.power.auxilliary",
"sys.power.fusion"
28 static int source_value[] = {
33 :
System(POWER_SOURCE, (int) s,
"Power", source_value[s], 0),
34 max_output((float) max_out), fuel_ratio((float) f_ratio),
35 route_changed(false), requested_power_level(1.0f)
59 max_output(p.max_output), fuel_ratio(p.fuel_ratio),
60 route_changed(false), requested_power_level(1.0f)
121 double energy_requested = 0;
122 double energy_avail = 0;
123 double total_distrib = 0;
126 if (availability < 0.4 && capacity > 0)
127 capacity -= (float) (0.03 * seconds);
156 if (joules > energy_avail)
157 joules = energy_avail;
159 energy_avail -= joules;
160 total_distrib += joules;
164 energy_requested += joules;
173 if (energy_avail > 0) {
176 if (energy_requested <= energy_avail) {
184 total_distrib += joules;
201 delivery = energy_avail * (request/energy_requested);
204 total_distrib += delivery;
217 if (total_distrib < baseline)
218 total_distrib = baseline;
222 if (total_distrib > 0) {
240 capacity -= (float) (total_distrib / effective_fuel_ratio);
279 bool changed =
false;