mars-sim icon indicating copy to clipboard operation
mars-sim copied to clipboard

Add new career types and secondary job

Open mokun opened this issue 3 months ago • 16 comments

Is your feature request related to a problem? Please describe.

  • As settlement grows beyond 100 people, more variety of services are needed. Currently, we have 19 types of jobs.

Describe the solution you'd like

  • Add more variety of common professionals such as nurses, data scientist, food technologist, minister, teacher, cyber security specialist, etc.
  • Add relevant tasks needed for a functioning society in a settlement of the size of 100 people.
  • Add a secondary career for each settler (preferably the one with skill type having the second highest points), especially for smaller settlements where unique tasks that tie to a career can be more easily covered.

Java classes involved

  • Job, JobType, SkillType, ScienceType

Version

  • pre-3.10.0

Additional context

mokun avatar Oct 09 '25 07:10 mokun

@bevans2000 @Urwumpe

Any professions you would like to see in near term ?

mokun avatar Oct 09 '25 07:10 mokun

Any professions you would like to see in near term ?

I don't really see a missing profession right now, but maybe we can specialize a few job types, like giving a technician some field of specialization or create special job types for specialized electricians, life support technicians and mechanics. Maybe also add a mechanism to our jobs to create different career paths and levels of experience and skill. Also, we lack some specialisation for mining and agriculture, we only have generic jobs for both, often covered by highly trained scientists, which we couldn't sustain for a larger colony.

Also, I am not sure if politician really makes sense as a job right now. I would suggest refactoring it towards an administrator, who at the lowest skill level just does administrative tasks for a bigger colony, but eventually can fill the role of a dedicated mayor for a settlement or higher levels of government.

Finally, maybe we could create a "Tourist" or "Big Bad Bored Billionaire" job type as implementation for space tourists, who just expects to be entertained and get driven to points of interest, but can't really do any meaningful job. But for a real tourism industry, we could really need more job types, like tourist guide, shop keeper, entertainer, room service, etc.

Urwumpe avatar Oct 09 '25 17:10 Urwumpe

giving a technician some field of specialization or create special job types for specialized electricians, life support technicians and mechanics

Yes. I do want specialties. Now it begs the question of how you would like to model specialization.

I see we'll first need to refine ScienceType.ENGINEERING, which is such an umbrella and generic term and would have encompass a large variety of professionals already in a large settlement.

if politician really makes sense as a job right now. I would suggest refactoring it towards an administrator

Yay politician is probably too generic and hasn't carried a whole lot of utility value yet. But personally speaking, I'm fascinated with Political Science and Political Philosophy as a subject and even went back to a community college a few years ago and took 2 of those courses just for fun :D

create a "Tourist" or "Big Bad Bored Billionaire" job type as implementation for space tourists

Great that you point out we could treat Tourist as a JobType.

I'll implement that right away to see where it takes us next.

mokun avatar Oct 12 '25 17:10 mokun

@bevans2000 @Urwumpe

Sooner or later, larger settlements will have to deal with the possibility of family planning.

How should we model children in mars-sim ?

They won't have a job per se and will go to school only I suppose.

Note that currently, we treat the Job class really as a job spec (we could have renamed Job into JobSpec.

Is it good to create a Child class that extends Job ?

In terms of RoleType, I assume it's better off we assign each child RoleType.CHILD.

If not, we'll have to handle Null RoleType (and also Null JobType, which can introduce more potential errors down the road.

mokun avatar Oct 12 '25 19:10 mokun

We shouldn't be artificially creating a Job type for child. The logic should handle a null Job. Role maybe we should create one but not job. We need a role for tourist

bevans2000 avatar Oct 12 '25 20:10 bevans2000

Role maybe we should create one but not job. We need a role for tourist

Yay I've created RoleType.GUEST for tourists to see how well it works.

mokun avatar Oct 12 '25 21:10 mokun

if politician really makes sense as a job right now. I would suggest refactoring it towards an administrator

btw, we've currently made these 4 role types below to take hold of the POLITICIAN job type.

We could change it in future as needed.

	/**
	 * Sets the role for a person.
	 *
	 * @param type {@link RoleType}
	 */
	public void setRole(RoleType type) {
		getRole().changeRoleType(type);

		// For a councils role's above commanders and sub-commander, 
		// his job must be set to Politician instead.
		if (type == RoleType.PRESIDENT
			|| type == RoleType.MAYOR
			|| type == RoleType.ADMINISTRATOR
			|| type == RoleType.DEPUTY_ADMINISTRATOR
				) {
			// Set the job as Politician
			mind.assignJob(JobType.POLITICIAN, true, JobUtil.SETTLEMENT, AssignmentType.APPROVED, JobUtil.SETTLEMENT);
		}
	}

I want to add more tasks for them to do.

There should be plenty of things to do such as :

  1. Create a good outreach program for settling Mars
  2. Maintain good publicity with the general public
  3. Lead public events
  4. Pay each settler a visit and address concerns
  5. Visit other settlements
  6. Forge alliances with other sponsors and settlements
  7. Act as a spokesperson during crises

mokun avatar Oct 12 '25 21:10 mokun

@bevans2000

What should be the Shift for tourists ?

I still need to create a ShiftSlot instance for tourist since it's a person.

/**
     * The work status of this slot.
     */
    public enum WorkStatus {
        ON_DUTY ("On-Duty"), 
        OFF_DUTY ("Off-Duty"), 
        ON_CALL ("On-Call"), 
        ON_LEAVE ("On-Leave");

I've wanted to set it permanently on-leave if it's possible.

However, this would prevent him from participating in any kind of work tasks that he may be interested in getting some hands-on experiences.

So for now, I'll set him on-call instead, so that he can still perform tasks (non-leadership related) if he wants.

mokun avatar Oct 12 '25 21:10 mokun

Are you adding tourists on now? I thought we were closing out 3.10?

bevans2000 avatar Oct 13 '25 05:10 bevans2000

I would put them as on leave, they can still do Task but nothing too important

bevans2000 avatar Oct 13 '25 05:10 bevans2000

I would put them as on leave

So I want tourists to show up for only, say, 60 sols.

Q: How do you use ScheduledEventManager to prompt them to depart or just disappear from the settlement after 60 sols ?

I notice the following method in ShiftSlot.

    /**
     * Sets this worker on a leave day.
     * 
     * @param duration Duration of the leave
     */
    public void setOnLeave(int duration) {
        onLeave = true;

        // Scheduled end of leave
        worker.getAssociatedSettlement().getFutureManager().addEvent(duration, this);
    }

Specifically speaking, I want to automatically call Settlement::removeACitizen() and vacate their bed designation, in sol 60, as scheduled, etc.

mokun avatar Oct 13 '25 19:10 mokun

So don't change the logic of the Shifts to be special for Tourists. That would be wrong. So assume you have a method called touristsArrive somewhere in a class called Tourism that controls tourists in a Settlement. This woudl create the new Persons with the Tourist Role. Then you need a ScheduledEventHandler that will trigger creating the tourists at some point in the future. So I would start with something like:

class TouristArrival implements ScheduledEventHandler {
   public void getDescription() {
         return "Tourists Arrival";
   }

   @Override
   public int execute(MarsTime now) {
         touristsArrive();
         return 0; // Do not repeat
   }
}

// Then register the handler to be triggered in the future
settlement.getFutureManager().addEvent(60 * 1000D, new TouristArrival());

Then the method will be called at 60 sols in the future. To remove them you can follow the same pattern. If you want to be clever, the TouristArrival can be reused to remove the tourists are a specific duration. Because the handler is an object it can hold state and will be recalled in the future if the execute returns a positive value.

However, in my opinion the arrival of Tourists should be via the existing ReSupplyMission. It could have a new parameter called 'touristCount'. Then when the Resupply mission arrives the Persons would automatically be added and you could give them the Tourist Role at that point. You would use the above logic to take them out of the Settlement some time in the future. But how do they return to Earth? We could just ignore the return transport at this stage and fix it later.

bevans2000 avatar Oct 13 '25 20:10 bevans2000

For tourists, I imagine they will be embedded in Areology, Biology, and Meteorology field science missions for those interested in it.

Besides visiting historical sites and finding abandoned man-made rovers/landers, there should be separate sightseeing tours visiting prominent landmarks.

There can even be rock climbing class to actually walk up or climb Olympus Mons.

mokun avatar Oct 14 '25 06:10 mokun

in my opinion the arrival of Tourists should be via the existing ReSupplyMission.

Sure. They'll arrive in the form of resupply missions.

But for departure, we'll need to add models of real interplanetary missions and how a rocket ship got refueled when they land and how this ship could bring back tourists and rock samples, etc.

mokun avatar Oct 14 '25 06:10 mokun

@bevans2000 @Urwumpe

Sooner or later, larger settlements will have to deal with the possibility of family planning.

How should we model children in mars-sim ?

First of all, children have so much implications (real life just like in Mars-sim development), I wouldn't recommend doing it in between minor versions, but make them the focus of a whole development increment. Children have development phases, reduced abilities, require care and schooling, have different tastes than adults, require the adult settlers to behave different towards them then to adults, require their own rules, etc. Also I wouldn't underestimate the part that comes before children: Pregnancy. Maybe its easier if the big white stork...lander brings the children. Thats a lot of work, that should better be well-prepared ahead and then done without much distractions or test challenges.

And I don't think this preparation belongs here, just like the job types that will be needed WHEN we have decided on how and how detailed we implement children. Lets start at the beginning, not at the end. New jobs can be defined easier than children.

Urwumpe avatar Oct 14 '25 12:10 Urwumpe

And I don't think this preparation belongs here, just like the job types that will be needed WHEN we have decided on how and how detailed we implement children.

Agree. There should be a dedicated and separate thread to prep mars-sim for discussing hosting pregnant women and raising kids, etc.

mokun avatar Oct 14 '25 18:10 mokun