-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal for thermal control + various changes #105
Open
gotmachine
wants to merge
15
commits into
ShotgunNinja:master
Choose a base branch
from
gotmachine:rule_modifiers_patch
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
146844d
Merge pull request #1 from ShotgunNinja/master
gotmachine 69915cd
Merge pull request #2 from ShotgunNinja/master
gotmachine 4754df6
Add an optional "modifier_degen" field to rule, that allow to specify…
gotmachine 0d674d2
- Added checks for modifiers_degen in places where modifiers where ch…
gotmachine dae588c
fixed incorrect time to breakdown estimate
gotmachine 943b6e0
- a few more modifiers, and more planner tweaks.
gotmachine 439a000
thermal system modifiers
gotmachine 339c3a9
somewhat working radiator module
gotmachine 3be097b
working radiator module
gotmachine 1d9d144
added habitat temperature degeneartion modifier
gotmachine 0682cc4
thermal control configs
gotmachine 414c524
more process config
gotmachine f3224b2
more process tweaks
gotmachine c4b3779
fixed VS git
gotmachine e53e19d
radiator module cleanup
gotmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,15 @@ public static double evaluate(Vessel v, vessel_info vi, vessel_resources resourc | |
break; | ||
|
||
case "temperature": | ||
k *= vi.temp_diff; | ||
k *= Math.Abs(vi.temp_diff); | ||
break; | ||
|
||
case "mod_temperature_pos": | ||
k *= vi.temp_diff > 0.0 ? 1.0 : 0.0; | ||
break; | ||
|
||
case "mod_temperature_neg": | ||
k *= vi.temp_diff < 0.0 ? 1.0 : 0.0; | ||
break; | ||
|
||
case "radiation": | ||
|
@@ -47,6 +55,10 @@ public static double evaluate(Vessel v, vessel_info vi, vessel_resources resourc | |
k /= vi.comforts.factor; | ||
break; | ||
|
||
case "mod_comfort_space_limiter": | ||
k *= vi.comforts.factor * ((1 - vi.comforts.factor) + (vi.living_space)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecessary parenthesis, possible int to double conversion that can be avoided (don't trust the compiler)
|
||
break; | ||
|
||
case "pressure": | ||
k *= vi.pressure > Settings.PressureThreshold ? 1.0 : Settings.PressureFactor; | ||
break; | ||
|
@@ -59,6 +71,15 @@ public static double evaluate(Vessel v, vessel_info vi, vessel_resources resourc | |
k /= (double)Math.Max(vi.crew_count, 1); | ||
break; | ||
|
||
case "crew_count": | ||
k *= (double)vi.crew_count; | ||
break; | ||
|
||
case "inverse": | ||
double i = 1.0 / k; | ||
k = double.IsInfinity(i) || double.IsNaN(i) ? 0.0 : i; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. replace it with
|
||
break; | ||
|
||
default: | ||
k *= resources.Info(v, mod).amount; | ||
break; | ||
|
@@ -80,7 +101,15 @@ public static double evaluate(environment_analyzer env, vessel_analyzer va, reso | |
break; | ||
|
||
case "temperature": | ||
k *= env.temp_diff; | ||
k *= Math.Abs(env.temp_diff); | ||
break; | ||
|
||
case "mod_temperature_pos": | ||
k *= env.temp_diff > 0.0 ? 1.0 : 0.0; | ||
break; | ||
|
||
case "mod_temperature_neg": | ||
k *= env.temp_diff < 0.0 ? 1.0 : 0.0; | ||
break; | ||
|
||
case "radiation": | ||
|
@@ -107,6 +136,10 @@ public static double evaluate(environment_analyzer env, vessel_analyzer va, reso | |
k /= va.comforts.factor; | ||
break; | ||
|
||
case "mod_comfort_space_limiter": | ||
k *= va.comforts.factor * ((1 - va.comforts.factor) + (va.living_space)); | ||
break; | ||
|
||
case "pressure": | ||
k *= va.pressurized ? 1.0 : Settings.PressureFactor; | ||
break; | ||
|
@@ -119,6 +152,15 @@ public static double evaluate(environment_analyzer env, vessel_analyzer va, reso | |
k /= (double)Math.Max(va.crew_count, 1); | ||
break; | ||
|
||
case "crew_count": | ||
k *= (double)va.crew_count; | ||
break; | ||
|
||
case "inverse": | ||
double i = 1.0 / k; | ||
k = double.IsInfinity(i) || double.IsNaN(i) ? 0.0 : i; | ||
break; | ||
|
||
default: | ||
k *= sim.resource(mod).amount; | ||
break; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string operations generate a lot of temporaries
use StringBuilder directly instead