mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-18 10:08:27 +00:00
Added simulated participants to the BeyondFacts Lab (#1208)
This commit is contained in:
1 parent
92d0ff68f4
commit
ef059ffd15
46 files changed
+1871
-71
No files matched your search
@@ -96,7 +96,8 @@ public static class BflStaleness
|
||||
/// <remarks>
|
||||
/// Line endings and spaces around a value do not count, since they change nothing the model reads. The card sort
|
||||
/// counts as a detail of its step; without one, or with an empty one, the fingerprint is the same as before the lab
|
||||
/// had a card sort, so that no confirmation of an older preparation turns into "Details changed".
|
||||
/// had a card sort, so that no confirmation of an older preparation turns into "Details changed". The same holds for
|
||||
/// the simulation of the step "Test situation" with generic counterparts.
|
||||
/// </remarks>
|
||||
/// <param name="form">The form.</param>
|
||||
/// <returns>The fingerprint, in hexadecimal digits.</returns>
|
||||
@@ -115,9 +116,28 @@ public static class BflStaleness
|
||||
if (form.CardSort is { IsEmpty: false } cardSort)
|
||||
AppendCardSort(text, cardSort);
|
||||
|
||||
if (form.Simulation is { Mode.HasPeople: true } simulation)
|
||||
AppendSimulation(text, simulation);
|
||||
|
||||
return Convert.ToHexStringLower(SHA256.HashData(Encoding.UTF8.GetBytes(text.ToString())));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Appends a simulation with people to the text a fingerprint is computed from.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Generic counterparts add nothing, so that the fingerprint stays the same as before the lab simulated people. The
|
||||
/// people count as a set, by the keys of their names: the order the person chose them in means nothing.
|
||||
/// </remarks>
|
||||
/// <param name="text">The text so far.</param>
|
||||
/// <param name="simulation">The simulation.</param>
|
||||
private static void AppendSimulation(StringBuilder text, BflSimulation simulation)
|
||||
{
|
||||
text.Append(SEPARATOR).Append("simulation").Append(SEPARATOR).Append(simulation.Mode.ToString()).Append(SEPARATOR);
|
||||
foreach (var key in simulation.People.Select(BflParticipant.NameKey).Distinct(StringComparer.Ordinal).Order(StringComparer.Ordinal))
|
||||
text.Append(key).Append(SEPARATOR);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Appends a card sort to the text a fingerprint is computed from.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user