Answer:
time (number of years)
Explanation:
Usually, when something "is a function of time", the independent variable is "time".
Here, we're talking about pigs and their number. If we were concerned with predicting how long they had been there based on their population, then their number might be the independent variable. Or, if we were concerned about the destruction they cause, the same would be true. Since we're saying the number of pigs changes with time, time is the independent variable.