设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12698|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 O+ K1 r7 `4 U/ L7 r
0 \; g) {7 M9 Q9 A' i4 o) m: Q我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
& k5 F% a- s. F9 m" M
" V  T4 J) G* d' zbegin P_read arriving) L& {3 j- P8 Z, x' C
    while 1=1 do begin2 Z3 {% X) |8 z  ~* V
        read A_tote from "data.txt" with delimiter "\n"4 G$ [0 R- z! g5 o4 T) f
        read A_time from "data.txt" with delimiter "\n"% S7 w6 k, P' o, @0 A# E
        read A_leave from "data.txt" with delimiter "\n"' a! _* ~% p; B# ?
        read A_picks from "data.txt" with delimiter "\n", z6 ]- W0 T! k. x* w, I
        set load type to A_tote  l- _: F6 K# O! o" K: j
        if A_tote="tote 1" then set A_induct to 1
- |; B$ x! O0 d2 O: v$ j        else if A_tote="tote 2" then set A_induct to 2
  c6 p9 v  J8 Q- o            else set A_induct to 3   
# n0 e& T+ _  c9 l/ K        set A_i to 0
# x; T# x9 h9 R  |        clone 1 load to P_induction* l; C/ _: G# h, t, H- b, Q
        wait for A_time sec
) ^' g2 W( W; I2 I    end+ K: m" J' t8 B5 |. Y  V( M
end+ C- ^8 P1 w  }* a, _7 U( W, h
5 }2 b* L# y- \" R+ p0 }
begin P_induction arriving
' ]! f2 U+ ^& N    if A_induct=1 then clone 1 load to P_pick1. q5 j: N; u5 z* @1 T
    else if A_induct=2 then clone 1 load to P_pick2
  j7 t" ~! f( l0 [. _        else clone 1 load to P_pick3
/ R* J. p( ?+ x; G5 V8 Q; Dend" c! u; H4 z% z, U* v
& {" V, A- y& X
begin P_pick1 arriving; m/ U" \  t; ?& @0 n6 Q- `5 m9 J
    set A_i to 1! B) Q% M7 @! f! s1 j
    move into Q_induct1
/ J4 ^8 ]3 X- N5 g* @4 e, {8 ]; [    move into pickaisle.induct1/ m+ [5 t( y2 G% Q
    while A_i<=30 do begin1 Y/ ?, K8 [7 f" C3 A6 R" B$ N
        travel to pickaisle.con(A_i)
! y7 U6 L& p- j# Z1 d* j& f; K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. w( M9 q" P: B% n        else wait for 10 sec$ U, L; [' V6 t( J- h! L1 u
        if A_i=A_leave then send to die
3 r+ W; U% K# `: h5 K        else inc A_i by 1
5 r0 a+ y; X  }    end6 C9 r- l$ o4 X) B1 Y
end3 q& I2 H) N6 h# C  f. x6 d

/ S0 r) g# Y1 [4 G5 `. ?begin P_pick2 arriving
6 K$ W& _: e2 ]. M/ h3 u; T2 V    set A_i to 11
9 w8 W( E7 x& N1 r8 u% L( L    move into Q_induct2
2 ^- v% p: S+ j2 u$ i1 i& q! A    move into pickaisle.induct2
0 o6 f! u$ F# }$ o( c. H- Z    while A_i<=30 do begin; T6 u0 K. \& U/ \$ n7 Q
        travel to pickaisle.con(A_i)
( {. H+ t4 J- ~) v5 v# K8 S; `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- [! o1 f. W1 u1 J. k
        else wait for 10 sec+ h7 h* ]; ~7 t4 I" p
        if A_i=A_leave then send to die
" Y/ O0 I: e# j3 Z( u        else inc A_i by 1
: O* R* j  ~. Z/ D+ T0 S3 Z    end
8 w: F; Q* v0 @end
: ~) _1 W4 s6 Q( L! V& S) o
4 K7 x' K: N$ `begin P_pick3 arriving- f- T5 I9 a& Z5 ^7 J) \7 _) w
    set A_i to 215 p2 o; O* ^- H( \) h" Q
    move into Q_induct3! r6 s* g# ]# H$ i; V
    move into pickaisle.induct3
4 `2 B0 |! U( m+ |    while A_i<=30 do begin3 _) e, z) F3 J
        travel to pickaisle.con(A_i)
! z' e/ v6 J5 l3 W! g' v6 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ]' w  Z8 o: t
        else wait for 10 sec
( s# b$ W6 h5 K( E. @* D. S        if A_i=A_leave then send to die1 x" K! E% P1 j$ ?3 U3 m, H
        else inc A_i by 18 l8 ^: Q% t  Z/ D( ^
    end
2 h$ ]& m4 n4 \3 W8 O1 Y  m% k# Pend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?7 C: O3 K  n: v$ W& N3 ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; d( T# f$ O; g6 x' z5 C* `9 q% a" D( P9 Y* ]% _$ G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 l7 X2 y5 g4 M# B0 V4 G% n
! o8 d0 R6 h  r另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& b2 m; ^3 W5 Y) z* K: J; {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 c  y* `+ h6 b( D3 r& Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 i8 O! r$ a( r0 c2 J& [( A3 `" V* M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# `/ {9 o# U1 ?# [
begin P_induction arriving6 t, K  I! t4 d
    clone 1 load to P_pick(A_induct); g. R. ?9 c" j" {! @- Q" C
end最大的系: |/ J2 ]0 Y" B+ c( ?* C$ }
) G2 G( u2 w. M$ M6 O9 k* @+ ~
begin P_pick arriving
# \: R/ K2 {: p4 |9 d: Z3 h/ J    set A_i to procindex * 10 + 1$ \; V( `7 q% B! D1 b
    move into Q_induct(procindex)- l3 e* W1 ~1 K1 \; q! H: H
    move into pickaisle.induct(procindex)& C8 x& }& A' Y3 d
    /*check the type of pickaisle.induct(i), for your last problem.*/
$ F+ C& {; a5 O# s
$ n1 y+ C, }: D/ H! }# J    while A_i<=30 do begin
* a. J$ _) o' H# @2 F1 T3 j- D        travel to pickaisle.con(A_i)
. m5 Z6 ~, U. z$ {, g8 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ~2 x/ p% W, O: @% d1 q2 F
        else wait for 10 sec# t# v* d% c6 v' n5 {( M6 H
        if A_i=A_leave then send to die' g& F% I; ~/ y2 Q$ t% r' H
        else inc A_i by 1
2 C+ _8 K6 ~) {3 S  K1 ^1 Q    end7 Y) b' q- r3 k% u: U* _8 v2 f
end5 k# ?$ y. k( x8 I0 D! r
( ?4 y: w$ S/ v$ M  x
其中的procindex为整形,代表当前process的序号。/ x5 j- y6 a) [5 w" Z
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-2-11 23:07 , Processed in 0.015497 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表