-
Notifications
You must be signed in to change notification settings - Fork 5
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
Various changes made to support Σκοπός over the past few years #1
Changes from all commits
3444513
23b59d5
8da676f
3abb452
fbf3f99
c8670b2
57d673a
4e5cebe
90167a2
bd5c8ba
5e5943d
91f0d5b
2fc8022
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ public struct ExtractDataJob : IJobParallelForDefer | |
[WriteOnly] public NativeArray<float> rxGain; | ||
[WriteOnly] public NativeArray<float> rxBeamwidth; | ||
[WriteOnly] public NativeArray<bool> rxHome; | ||
[WriteOnly] public NativeArray<bool> rxTracking; | ||
[WriteOnly] public NativeArray<double3> rxPos; | ||
[WriteOnly] public NativeArray<float3> rxDir; | ||
[WriteOnly] public NativeArray<float> rxAMW; | ||
|
@@ -47,14 +48,15 @@ public void Execute(int index) | |
txBeamwidth[index] = tx.beamwidth; | ||
txHome[index] = tx.isHome; | ||
txPos[index] = tx.position; | ||
txDir[index] = tx.isHome ? (float3) (rx.position - tx.position) : tx.dir; | ||
txDir[index] = tx.isTracking ? (float3) (rx.position - tx.position) : tx.dir; | ||
|
||
rxFreq[index] = rx.freq; | ||
rxGain[index] = rx.gain; | ||
rxBeamwidth[index] = rx.beamwidth; | ||
rxHome[index] = rx.isHome; | ||
rxTracking[index] = rx.isTracking; | ||
rxPos[index] = rx.position; | ||
rxDir[index] = rx.isHome ? (float3) (tx.position - rx.position) : rx.dir; | ||
rxDir[index] = rx.isTracking ? (float3) (tx.position - rx.position) : rx.dir; | ||
rxAMW[index] = rx.AMW; | ||
} | ||
} | ||
|
@@ -79,7 +81,7 @@ public struct CalcAntennaBodyNoise : IJobParallelForDefer | |
{ | ||
[ReadOnly] public NativeArray<OccluderInfo> occluders; | ||
[ReadOnly] public NativeArray<float> rxPrecalcNoise; | ||
[ReadOnly] public NativeArray<bool> rxHome; | ||
[ReadOnly] public NativeArray<bool> rxTracking; | ||
[ReadOnly] public NativeArray<double3> rxPos; | ||
[ReadOnly] public NativeArray<float> rxGain; | ||
[ReadOnly] public NativeArray<float> rxBeamwidth; | ||
|
@@ -88,7 +90,7 @@ public struct CalcAntennaBodyNoise : IJobParallelForDefer | |
[WriteOnly] public NativeArray<float> bodyNoise; | ||
public void Execute(int index) | ||
{ | ||
bodyNoise[index] = rxHome[index] ? Precompute.NoiseFromOccluders(rxPos[index], rxGain[index], rxDir[index], rxFreq[index], rxBeamwidth[index], occluders) : rxPrecalcNoise[index]; | ||
bodyNoise[index] = rxTracking[index] ? Precompute.NoiseFromOccluders(rxPos[index], rxGain[index], rxDir[index], rxFreq[index], rxBeamwidth[index], occluders) : rxPrecalcNoise[index]; | ||
} | ||
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. I wonder about this particular change. The purpose of this job was to defer the noise calculation for antennas whose pointing was not determined earlier, specifically: the ground station antennas that are allowed to "simultaneously" point at any possible peer (as a gameplay simplification). But isTracking is also changing, from:
to:
I don't know if those are the same, ie do only ground stations have Target == null? 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. To your question
I think the answer is yes, because this is how Target is initialized, where we see some of the logic that was in CanTarget: if (config.HasNode("TARGET"))
Target = Targeting.AntennaTarget.LoadFromConfig(config.GetNode("TARGET"), this);
else if (Shape != AntennaShape.Omni && (ParentNode == null || !ParentNode.isHome) && !(Target?.Validate() == true) && HighLogic.LoadedSceneHasPlanetarium)
Target = Targeting.AntennaTarget.LoadFromConfig(SetDefaultTarget(), this); The only intended change in behaviour in the changes surrounding the introduction of IsTracking is that you can explicitly configure an antenna to have this kind of track-everything-at-once behaviour using Those ground stations are not home, so that you cannot downlink your science to a random Орбита station (or maybe even someone’s TVRO dish!) using the entire C band. |
||
} | ||
|
||
|
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.
Just be careful here, as the pointingloss for a poorly defined angle (ie direction to target is somehow near 0,0,0) will produce bad results. Unsure how much this particular library code is exercised now, especially with the conversion to jobs.
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.
Well, this won’t affect cases where ToTarget is near zero, only those where it is zero.
It seems unlikely that it would be zero in cases where it should be, since it is computed as difference in double precision where one of the terms is Position, which is PrecisePosition, which is a position in double precision (the other term of the difference, Target.transform.position, is regrettably in single precision, but the result, while perhaps garbage, shouldn’t come out to 0).
(The difference is then converted to single precision but this matters not. All that switching between precisions is neither a recipe for performance nor correctness, but let’s not get distracted.)
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.
Could be irrelevant if calculating garbage data anyway [what is ToTarget with a somehow broken/invalid target?]. Other source of potentially bad result is maybe no longer possible for reason you described [PrecisePosition is double]. Main indicator might be vessels & targets that are extremely far away from current origin [ie, focus on a vessel past Pluto, what are the calculations for vessels/targets in similar orbit near Earth?]