- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Solvers/SAT/ISAT/ISATBaseModelAssignmentDescription.cpp

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013 //# CHECKED MJP 08-07-2002
    00014
    00015 #include <cassert>
    00016 #include <cstdio>
    00017 #include <Mers/Models/Base/BaseModelAssignment.h>
    00018 #include "ISATBaseModelAssignmentDescription.h"
    00019
    00021
    00022 using Mers::Models::Base::BaseModelAssignment;
    00023 using Mers::Solvers::SAT::ISAT::ISATBaseModelAssignmentDescription;
    00024 using std::ostream;
    00025
    00027
    00028 //----------------------------------------------------------------------------------------
    00029 // Public Constructors, Copy Constructors, & Destructors
    00030 //----------------------------------------------------------------------------------------
    00031
    00032 ISATBaseModelAssignmentDescription::ISATBaseModelAssignmentDescription(BaseModelAssignment const *new_assignment_p)
    00033 {
    00034         assignment_p = new_assignment_p;
    00035 }
    00036
    00037 ISATBaseModelAssignmentDescription::~ISATBaseModelAssignmentDescription()
    00038 {
    00039 }
    00040
    00041 //----------------------------------------------------------------------------------------
    00042 // Public Function Members
    00043 //----------------------------------------------------------------------------------------
    00044
    00045 BaseModelAssignment const *
    00046 ISATBaseModelAssignmentDescription::get_assignment_p() const
    00047 {
    00048         return assignment_p;
    00049 }
    00050
    00051 ostream &
    00052 ISATBaseModelAssignmentDescription::print(ostream & stream) const
    00053 {
    00054         stream << "(" << assignment_p->getVariable()->getName()
    00055                 << " = " << assignment_p->getValue()->getName() << ")";
    00056         return stream;
    00057 }
    00058
    00059 //----------------------------------------------------------------------------------------
    00060 // Public Operators
    00061 //----------------------------------------------------------------------------------------
    00062
    00063 bool
    00064 ISATBaseModelAssignmentDescription::operator == (ISATPropositionDescription const &other) const
    00065 {
    00066         BaseModelAssignment const * asg = ((ISATBaseModelAssignmentDescription *) &other)->assignment_p;
    00067         return *(assignment_p->getVariable()) == *(asg->getVariable()) &&
    00068                 *(assignment_p->getValue()) == *(asg->getValue());
    00069 }