-
Notifications
You must be signed in to change notification settings - Fork 34
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
Improve and rebalance Task/Subtask/Shift #1112
Comments
10.28.2023 - change: rename Conversation to Converse - change: rename ConversationMeta to ConverseMeta - change: add calling a subtask in invitee - new: add targetID and target person in Task for invitee or initiator - change: revise addSubTask() to return the status of whether a subtask can be added or not Relates to #1112
Using string is too fragile, the string changes due to language and it stops. There is too much reliance on strings. |
As to Conversation Task. I have no idea how it is selected. Change the MetaTask so we can see the logic in the scoring and work out why it is low down. |
How about using the 'SimpleName' of that MetaTask or that Task ? If I need to get the preference score of a Task, it's a waste to have to first create the Task class by |
I agree but preference is based on the MetaTask and these instances are already created, so the object is already in memory. If we pass a string every call of this method would have to change. But in the current approach how we choice the preference is hidden from the caller which is good abstracted design. |
10.29.2023 - new: create converseMeta in MetaTaskUtil for use in EatDrink and Converse - change: rename TaskProbabilityUtil to TaskUtil - change: relocate isIdleTask() from Converse to TaskUtil - fix: revert the previous incorrect change of word back to "conversation" in mars-sim-console package - update: change flatlaf to 3.2.5 Relates to #1112 and 7b61459
Sorry, I missed this is the original post. This has nothing to do with Tasks. It is all configurable from the ShiftSpec which is configured in settlement.xml. Either change one of the existing patterns and create a new one and assign it to a settlement template. Don't add any custom code to handle the edge cases though; this is totally configurable now. I expect that Settlement is using the "Skeleton Night Shift" shift pattern which has only 10% of the population active at night since that is what the pattern is addressing. |
So what makes a settlement commander decide to take a skeleton (10%) night shift versus a 20%, 30% or 50% night shift ? Can we create a TabPanelShift and use a combobox for players to choose various types of shift for a settlement ? |
Not really that easy because the Shift are constructed and persons assigned as they join the Settlement. Just change the Shift Pattern assigned in Settlement template |
I can now see in SettlementConfig's parseItemXML(), we have the following : //Look up the shift pattern
String shiftPattern = templateElement.getAttributeValue(SHIFT_PATTERN);
if (shiftPattern == null) {
if (defaultPopulation >= 12) {
shiftPattern = DEFAULT_3SHIFT;
}
else {
shiftPattern = DEFAULT_2SHIFT;
}
}
ShiftPattern pattern = getShiftPattern(shiftPattern);
// Add templateID
SettlementTemplate template = new SettlementTemplate(
settlementTemplateName,
description,
predefined,
sponsor,
pattern,
defaultPopulation,
defaultNumOfRobots); It seems that currently the shift pattern is determined by its initial population. When it's more than 12, then, it uses the "standard 3 shift", other it's "standard 2 shift", right ? But we have actually defined a total of 4 shift patterns in <!-- The Standard patterns are the default and but always be present.
The others can be added/deleted -->
<shifts>
<shift-pattern name="Standard 3 Shift" rotation-sols="2">
<shift name="A" start="200" end="550" pop-percentage ="40"/>
<shift name="B" start="550" end="900" pop-percentage ="40"/>
<shift name="Night" start="900" end="200" pop-percentage ="20"/>
</shift-pattern>
<shift-pattern name="Standard 2 Shift" leave-perc="3" rotation-sols="4">
<shift name="Day" start="200" end="700" pop-percentage ="50"/>
<shift name="Night" start="700" end="200" pop-percentage ="50"/>
</shift-pattern>
<shift-pattern name="Skeleton Night Shift" leave-perc="3" rotation-sols="2">
<shift name="Day" start="500" end="930" pop-percentage ="90"/>
<shift name="Night" start="900" end="530" pop-percentage ="10"/>
</shift-pattern>
<shift-pattern name="Long 3 Shift" rotation-sols="4">
<shift name="A" start="200" end="600" pop-percentage ="40"/>
<shift name="B" start="500" end="900" pop-percentage ="40"/>
<shift name="Night" start="900" end="200" pop-percentage ="20"/>
</shift-pattern>
</shifts>
|
I can see that the attribute "shift-pattern" is optional in <xs:element name="template">
<xs:complexType>
<xs:sequence>
<xs:element ref="building" maxOccurs="unbounded"/>
<xs:element ref="vehicle" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="robot" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="equipment" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="bin" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="resource" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="part" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="part-package" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="building-package" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="resupply" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="sponsor" type="xs:string"/>
<xs:attribute name="shift-pattern" type="xs:string" use="optional"/>
<xs:attribute name="default-population" type="xs:integer"/>
<xs:attribute name="number-of-robots" type="xs:integer"/>
</xs:complexType>
</xs:element> And I can see the
It would be great to let player create new shift patterns or at least choose a different shift pattern than the one predefined for a settlement in xml. |
One question is, say if a settlement initially has 24 populations but 12 of them die, will it intelligently switch to another shift pattern to cope with the loss of settlers ? For the time being, I'll go to add "Standard 4 Shift" for that brand new "Hub Settlement" that has 36 people just to see how realistic it is to have 4 shifts. |
10.30.2023 - new: add new shift pattern definition of "Standard 4 shift" in settlements.xml - new: add STANDARD_4_SHIFT in SettlementConfig - change: revise parseItemXML() in SettlementConfig to make use of 3 shift patterns. Relates to #1112
Ok. |
Remember the ShiftManager automatically rotates Persons around the Shifts so this rebalances when persons die. The Person is given a day's, leave when changing pattern to allow their sleep to adjust. |
It's good it does that to rebalance the missing shift. However, the shift pattern should also be under reconsideration for a change when
Hmm... giving a settler one day of leave is very generous indeed :D For a small settlement, we may not have that kind of luxury though. |
11.01.2023 - fix: add restoring targetID in Task's reinit() as used in Converse task Relates to #1112
11.01.2023 - fix: add restoring targetID in Task's reinit() as used in Converse task - fix: allow colonists set to be non-transient in Population Relates to #1112
11.01.2023 - fix: call setTarget() in Converse - fix: correct null building in lookTobeAssignedABed() in Sleep - change: make Colonist serializable Relates to #1112
11.01.2023 - change: make target and targetID private in Task - change: use getTarget() and getTargetID() in Converse Relates to #1112
Here in Catarina, a 4-person settlement, I found this somewhat unreasonable : 3 of them are having Night Off Duty shift. 1 of them are on Night On Leave. So no one is on duty at all. Can we set some constraints on allowing people to be off duty based on both the percentage and # of available personnel ? |
What was the Shift Pattern assigned to the Settlement? The 1 person On Leave is probably changing shift to Day. |
For now, it's STANDARD_2_SHIFT for any settlements with less than 12 people. |
Anywhere would tell me if a person would have the day off on sol ___ until what time ? |
Look at which Shift Schedule has been assigned. That defines how many are on each Shift. It us all configuration driven and that shouldn't be changed. So if you think it's wrong change the automatic selection of the Shift schedule, don't add hard coded logic. |
I think they get the rest of the Shift off as leave. |
but how would a player get notified that a person gets the rest of the shift or the rest of the day off ? The code may have done it. But is there a method you can call to find out and can you add a label in the Person Window saying he will be on leave till sol x: xxx ? |
Sure, we show the extended Shift description somewhere. That can be changed. |
Describe the situation
Expected and unexpected behavior
Conversation
andConversationMeta
class.Java classes involved
Conversation
,Preference
Screenshots
Specifications
The text was updated successfully, but these errors were encountered: