More on Resource Pools

87 views
Skip to first unread message

gra...@harris.net.nz

unread,
Feb 24, 2023, 12:15:47 AM2/24/23
to TaskJuggler Users
I have come up with a couple of macros which let me allocate one person from a pool:

macro Any [ allocate none {alternative ${1} select minallocated persistent } ]
resource none "deliberately unavailable" { limits { dailymax 60min }  efficiency 0 }
# none ensures one of the { alternative } resources is always chosen- I think
# ${1} is the ID of a group of resources

macro Prefer [ allocate ${2} {alternative ${1} select minallocated persistent } ]
# usage like 'task taskID "taskname" { effort Nd ${Prefer "groupID" "personID" } }'
# specify a preferred individual if available, otherwise pick an { alternative }

I think these work- hard to tell because my project eventually fails to compile because the root scenario seems to go on forever due to a large demand for a resource type, which could be met by multiple resources from a pool.

What I need now is a macro, or other technique, to allow several people from a larger pool to be allocated.
I have seen a macro like Any just used repetitively, and I guess that works. But I am trying to generate my task statements from an excel formula and repeating macros n times seems more complex to code in excel- especially since my task demand side comes from one set of spreadsheets and my resource pool side comes from a different set of spreadsheets.

Has anyone written a TJ3 macro to do something like this?
Reply all
Reply to author
Forward
0 new messages