1 /*******************************************************************************
2 * Copyright (c) 2017 Politecnico di Torino and others.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Apache License, Version 2.0
6 * which accompanies this distribution, and is available at
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *******************************************************************************/
10 package mcnet.components;
12 import com.microsoft.z3.Context;
13 import com.microsoft.z3.DatatypeExpr;
15 /** Represents a generic network object.
18 public abstract class NetworkObject extends Core{
20 public NetworkObject(Context ctx,Object[]... args) {
24 protected DatatypeExpr z3Node;
25 protected boolean isEndHost;
27 * Get a reference to the z3 node this class wraps around
30 abstract public DatatypeExpr getZ3Node();
32 public String toString(){
33 return z3Node.toString();
36 //There is probably an error: z3Node.hashCode = 0 because AST.hashCode() has always hash=0
37 /*public int hashCode(){
38 return z3Node.hashCode();
42 * A simple way to determine the set of endhosts
45 public boolean isEndHost(){
50 * Wrap methods to set policy
52 * @throws UnsupportedOperationException
54 void setPolicy (Object policy) throws UnsupportedOperationException{
55 throw new UnsupportedOperationException();