module vessel; from cargo import CargoType; export Vessel, VesselList, StowableArea, GeneralStowChars; object AccessChars components: dc:DoorChars and hc:HatchChars and rc:RampChars and bc:BoomChars and oc:OpeningChars and ddc:DimensionDoorChars and doc:DimensionOpeningChars and dec:DimensionElevatorChars and ec:ElevatorChars; operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*Access Characteristics include information regarding the characteristics of all areas the cargo needs to travel over or through in order for it to arrive in a designated stowable area *); end AccessChars; object AccessEntityChars components: AccessEntity:number and AccessEntityType: Door or Opening or Hatch or Opening or Ramp or Elevator; operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description:(*An access entity is a stowable area within a partition *); end AccessEntityChars; object Area components: Door:string or Elevator:string or Hatch:string or Ramp:string or Boom:string or Opening:string; description: (*identifies what "type" of area we are dealing with*); end Area; object AreaDescrip is string*; object AreaList is string*; object AreaServiced components: StowableAreaId:string*; description: (*refers to the areas that are serviced by some access facility such as a boom or an opening or a ramp *); end AreaServiced; object BallastChars components: LiquidType:string and TankName:string and TankNumber:string and MaxWeight:number and NormalWeight:number; operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*these are characteristics that reference the ballast (ie trim and stability) of a ship *); end BallastChars; object Barge; object Boom; (* enumerated type *) object BoomChars inherits from MetaCharacteristics components: VesselName:string and BoomName:string and Location:string and BoomCapacity:number and Usable:boolean and ParentBooms:string* and as:AreaServiced*; operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (* a boom is a crane*); end BoomChars; object ContainerFacilitiesChars inherits from MetaCharacteristics components: ContainerType:string and Location and Orientation and StackingLimit and StackHeight:number; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*container facilities are area within a vessel that are designed to hold containers*); end ContainerFacilitiesChar; object ContainerTier; object Door; (*enumerated type *) object DimensionDoorChars inherits from MetaCharacteristics components: Length:number and Width:number and FrameHeight:number and Height:number; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*the characteristics of a door that have to do with dimensions*); end DimensionDoorChars; object DimensionElevatorChars inherits from MetaCharacteristics components: ElevatorLength:number and ElevatorWidth:number and ElevatorHeight:number and ElevatorCapacity:number; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*the characteristics of an elevator that have to do with dimensions*) ; end DimensionElevatorChars; object DimensionOpeningChars inherits from MetaCharacteristics components: OpeningLength:number and OpeningWidth:number and OpeningHeight:number; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*the characteristics of an opening that have to do with dimensions*); end DimensionOpeningChars; object DimensionStowChars inherits from MetaCharacteristics components: LongDistance:number and VertDistance:number and CargoSqFt:number and (*area of eligible cargo*) AreaFt:number and Volume:number and TargetWeight:number and RecommendedWeight:number and MaxUsableHeight:number and MaxWeight:number and MaxWidth:number and TotalArea:number and BoomCap:number and BaleCap:number and StressNum:number and AdditionalWeight:number and MaxLength:number and MaxHeight:number and ActualWeight:number and TargetArea:number and RemArea:number and PcntSqFt:number and (* % of csqft for this ClassNo*) LbSqFt:number and (*recommended area density pounds per square foot*); description: (*the characteristics of a stowable area that have to do with dimensions*); operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); end DimensionStowChars; object DoorChars inherits from MetaCharacteristics components: DimensionDoorChars and DoorId:string and Location and notes:string* and Usable and as:AreaServiced*; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); end DoorChars; object Elevator; (* enumerated type *) object ElevatorChars inherits from MetaCharacteristics components: VesselName:string and ElevatorId:string and ElevatorType:string and ElevatorName:string and Location and as:AreaServiced* and Usable; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: ; end ElevatorChars; object Flat; object GeneralChars inherits from MetaCharacteristics components: VesselType:string and FuelCap:number and Range:number and MaxSpeed:number and Speed:number; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description:(*general characteristics of a vessel *); end GeneralChars; object GeneralDimensionChars inherits from MetaCharacteristics components: DeadWeight:number and Length:number and MastHeight:number and Beam:number and Displacement:number and MaxDraft:number and LightDraft:number and Draft:number and AreaFt:number and AreaCenters:number; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*the characteristics of a vessel that have to do with dimensions *); end GeneralDimensionChars; object GeneralStowChars inherits from MetaCharacteristics components: StowAreaAbove:string and StowAreaBelow:string and PreStowPODS:string* and PreStowPOES:string* and CargoTypes:string* and CargoVCG:number and ClassNum:number and Frozen:boolean and BrokenStowFactor:number and UtilizationArea:number and UtilizationMTONS:number and AssistStowFilled:boolean and Description:string and CellCode:number; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*general characteristics of a stowable area *); end GeneralStowChars; object Hatch; (*enumerated type*) object HatchChars inherits from MetaCharacteristics components: VesselName:string and HatchId:string and HatchName:string and HatchType:string and Usable and Location and HatchLength:number and HatchWidth:number and as:AreaServiced*; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); end HatchChars; object HoldChars inherits from MetaCharacteristics components: HoldName:string and StowAreaId:string*; operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*Contains information about holds within ships*) ; end; object LevelChars inherits from MetaCharacteristics components: LevelName:string and DeckSpec:string and LevelType:string; operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (*Contains information about levels within ships*) ; end LevelChars; object Location Unspecified:string or Forward:string or Aft:string or Port:string or Starboard:string or Midship:string or AftMidship:string or ForwardMidship:string or PortForward:string or PortAft:string or PortMidship:string or StarboardForward:string or StarboardMidship:string or StarboardAft:string; object LocationList is Location*; object class MetaCharacteristics; object OnBoardStowFacilitiesChars inherits from MetaCharacteristics components: Area and HeightExt:number and HeightInt:number and LengthExt:number and LengthInt:number and Location and Name:string and QuantityAL:integer and OBType:integer and Volume:number and WeightEmpty:number and WeightLifting:number and OBWeightMax:number and WidthExt:number and WidthInt:number; operations: changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description:; end OnBoardStowFacilitiesChars; object Opening; (* enumerated type *) object OpeningChars inherits from MetaCharacteristics components: DimensionOpeningChars and OpeningId:string and OpeningType:string and Usable and Location and as:AreaServiced*; operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); end OpeningChars; object Orientation is string; object PartitionChars inherits from MetaCharacteristics components: Location and FireResist:boolean and LiquidResist:boolean and AdjacentStowArea:string and AccessEntityChars*; operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: (* partitions are seperators between stowable areas *); end PartitionChars; object Ramp; (*enumerated type *) object RampChars inherits from MetaCharacteristics components: VesselName:string and RampId:string and notes:string* and RampMaxWeight:number and RampLength:number and RampWidth:number and RampClearanceUnder:number and RampHeight:number and RampCapacity:number and Usable:boolean and RampType and Stowable:boolean and as:AreaServiced* and Location; operations:changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel); description: ; end RampChars; object RampType components: fixed:string or hinged:string or portable_vehicular:string; description: (* enumerated type for ramps *); end RampType; object Seashed; object StackingLimit is integer; object StowableArea inherits from MetaCharacteristics (*components:*) StowableAreaId:string and gsc:GeneralStowChars and DimensionStowChars and WeatherDeck:boolean and Alternate:string and StowOrder:number and DeckStress:number and RORO:boolean and (* is the area roll-on roll-off *) LOLO:boolean and (* is the area lift-on lift-off *) PartitionChars* and (* areas can have numerous partitions (walls)*) type: Barge or ContainerTier or Seashed or Ramp or Flat and notes:string*(*;*) operations:; description:; end StowableArea; object Usable is boolean; object Vessel inherits from MetaCharacteristics components: name:string and hullNumber:number and gc:GeneralChars and GeneralDimensionChars and sa:StowableArea* and LevelChars* and hcs:HoldChars* and BallastChars and ContainerFacilitiesChars and OnBoardStowFacilitiesChars and ach:AccessChars and StowGuidelines:string; operations:; description: (*Contains information about ships*); end Vessel; object VesselList components: names:string*; description: (*list of vessel names*); end VesselList; operation changeAnyChar(v:Vessel,ac:MetaCharacteristics,commit:boolean) -> (v':Vessel) description: (* The user can change any characteristic on any vessel. The user must confirm any change before it's committed. *); post: if commit = true then (v' != v) else (v' = v); end changeAnyChar; end vessel; (**)