Colony Aggregate
Aggregates Definition
This file defines the colony aggregate structure within the Roll Claw domain model.
Implementation
Colony Aggregate Definition
File: domain/aggregates/colony_aggregate.pseudo
// Colony Aggregate - Root entity for a cat colony with associated entities
class Colony {
// Identity
string id
string name
string address
string previousUse
boolean isActive
Date established
// References
List<Person> caretakers
Map<Person, string> caretakerRoles // "primary", "backup", "medical", etc.
List<Location> locations
List<Equipment> equipment
List<Cat> cats
List<Task> tasks
List<ColonyEvent> events
List<Threat> threats
List<InventoryItem> inventory
List<SocialGroup> socialGroups
List<FeedingSchedule> feedingSchedules
Map<Cat, AccessLevel> catAccessLevels
string notes
// Methods
function addCat(Cat cat)
function removeCat(Cat cat, string reason, Date date)
function recordEvent(ColonyEvent event)
function addEquipment(Equipment equipment)
function getCatsByLocation(Location location)
function getActiveCats()
function getInventoryItems()
function getEquipmentByStatus(EquipmentStatus status)
function getTasksDue(Date date)
function getOverdueTasks()
function addCaretaker(Person person, string role)
function removeCaretaker(Person person, Date date)
function updateStatus(boolean isActive, string reason, Date date)
function addThreat(Threat threat)
function recordSocialGroup(SocialGroup group)
function getRelatedEvents(Cat cat)
function getActiveThreats()
function addLocation(Location location)
function removeLocation(Location location, Date date)
function updateFeedingSchedule(FeedingSchedule schedule)
function getEquipmentByType(string type)
function getCatsByStatus(CatStatus status)
function getRecentEvents(Date since)
function getPrimaryCaretaker()
function getMissingCats()
function getCatsNeedingMedicalAttention()
function getLowInventoryItems()
function getEquipmentNeedingMaintenance()
function recordInventoryCheck(Date date, Person by)
function recordEquipmentMaintenance(Equipment equipment, string maintenanceType, Date date, Person by)
function updateCatAccessLevel(Cat cat, AccessLevel level, Date date, Person by)
function generateDailyTasks()
function getFeedingStations()
function getWaterSources()
function getLitterBoxes()
function analyzeCatMovement()
function generateHealthReport()
function recordWeatherImpact(WeatherCondition condition, string impact, Date date)
function analyzeResourceUsage()
function getPopulationStatistics()
function getTerritoryMap()
}
class ColonyNetwork {
List<Colony> colonies
Map<Colony, List<Colony>> neighboringColonies
Map<Colony, Float> distanceMatrix
// Methods
function addColony(Colony colony)
function setNeighboringColonies(Colony colony1, Colony colony2)
function transferCat(Cat cat, Colony fromColony, Colony toColony, Date date)
function getCatsTransferredBetween(Colony colony1, Colony colony2)
function findColonyByAddress(string address)
function getColonyInRadius(Location centerPoint, float radiusKm)
function recordInterColonyMovement(Cat cat, Colony fromColony, Colony toColony, Date date)
function analyzeInterColonyMovement()
function mergeColonies(Colony primary, Colony secondary, string reason, Date date)
function getActiveColonies()
}
class FeedingSchedule {
// Properties
Colony colony
List<FeedingTime> regularTimes
Map<FoodSource, List<FeedingTime>> automatedFeeders
Map<Location, List<FeedingTime>> manualLocations
// Methods
function addRegularFeeding(Time time, string foodType, float amount)
function removeRegularFeeding(Time time)
function updateAutomatedFeeder(FoodSource feeder, List<FeedingTime> times)
function getFeedingTimesForLocation(Location location)
function getFeedingTimesForEquipment(FoodSource foodSource)
function getNextScheduledFeeding(Date currentDate, Time currentTime)
function isAutomatedFeedingAt(Time time)
}
class FeedingTime {
// Properties
Time time
float amountCups
FoodSource.FoodType foodType // WET, DRY, MIXED
List<Day> daysOfWeek // if not daily
boolean isAutomated
// Methods
function isScheduledFor(Day day)
function getTimeUntilNext(Date currentDate, Time currentTime)
}
class ColonyStatistics {
// Properties
Colony colony
Date generatedDate
int activeCats
int indoorCats
int outdoorCats
int missingCats
int catsByGender (Map<Gender, Integer>)
int catsByCoatPattern (Map<CoatPattern, Integer>)
int socialGroups
int equipmentByStatus (Map<EquipmentStatus, Integer>)
Map<TaskStatus, Integer> taskStatuses
float feederCapacityRemaining // percentage
float litterBoxUtilization // percentage
// Methods
function getPopulationTrend()
function getEquipmentReliability()
function getTaskCompletionRate()
function getResourceConsumptionRate()
function getHealthMetrics()
}
class TerritoryMap {
// Properties
Colony colony
Date updated
Map<Location, List<Cat>> frequentVisitors
Map<Location, List<Cat>> permanentResidents
Map<Cat, List<Location>> catTerritories
Map<SocialGroup, List<Location>> groupTerritories
List<Location> conflictZones
// Methods
function identifyOverlaps()
function getHighTrafficAreas()
function getSocialGroupBoundaries()
function getUnusedAreas()
function getCatPreferredLocation(Cat cat)
function updateCatTerritory(Cat cat, List<Location> territories)
function getOptimalFeedingLocations()
function analyzeSeasonalChanges(Date seasonStart, Date seasonEnd)
}
Related Components
- See the Domain Model Overview for more information on how this component fits into the overall domain model.