设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14308|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& O& z* c8 f, w' F! l7 C
: h$ d. r2 G3 s6 R4 c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) [4 o$ [3 u  B  j- Y; X, i: D! M& ?: q. T+ a2 e
begin P_read arriving
: z( \; y7 {6 m: X0 Y6 |' c: Z    while 1=1 do begin+ u) l0 D2 o( D" }; {& F
        read A_tote from "data.txt" with delimiter "\n"
  F* u! A0 k0 R2 _        read A_time from "data.txt" with delimiter "\n"* ^2 i' E' j* h" |( T
        read A_leave from "data.txt" with delimiter "\n"
8 W* I( |/ Y; m$ q% Q3 {        read A_picks from "data.txt" with delimiter "\n"
7 |/ Y0 [4 k/ R9 Q7 g1 Z" f' E        set load type to A_tote
, T' B+ S, e8 H' T% T, H        if A_tote="tote 1" then set A_induct to 1
$ T( G( R& M5 M" E, A- I        else if A_tote="tote 2" then set A_induct to 2
# D2 _2 o7 x! t3 ~  @            else set A_induct to 3   
% e" d' l3 p1 K- C- D4 N        set A_i to 07 m- F2 z# S% _" e- N8 z+ j9 W- P
        clone 1 load to P_induction
6 w% w& K9 G0 d9 r2 I+ @, V' j        wait for A_time sec
* q" o" Y- E; Q; l* P8 |/ k5 x    end
4 {. I3 ]  `4 G5 vend0 t; {6 H3 Z8 A; `4 b% c3 K

, C9 v7 ^; T; d+ \begin P_induction arriving
# z4 ~' g0 f; w1 m  ]    if A_induct=1 then clone 1 load to P_pick1
' w1 ]4 T, t6 b! c+ C0 @+ F+ Q    else if A_induct=2 then clone 1 load to P_pick2
3 b5 ?4 _3 l1 g- k& e0 O$ u        else clone 1 load to P_pick30 D' L, G" j& f( ~0 }$ \3 u
end
* }9 x- l4 z; A4 _
. e( u2 h4 c/ h- [5 z0 A) fbegin P_pick1 arriving
; Q0 `" j, R8 P  E) d8 _5 Z& Z    set A_i to 1: F7 |& M# O/ U* s
    move into Q_induct14 h' z2 u1 V8 Q+ N- m# W) R
    move into pickaisle.induct1
# e  e& S' S" s5 [0 q1 L    while A_i<=30 do begin+ C, {9 F$ u* f- `: o5 A
        travel to pickaisle.con(A_i)7 f6 G; m' h/ R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, G' M3 l4 M+ [4 d# Z- e+ n0 F        else wait for 10 sec. S9 |  k" C5 Y3 n0 Y
        if A_i=A_leave then send to die
- r- i5 R- U# S( t        else inc A_i by 1
% }5 F9 M- x- w) m. \% Z$ a    end: a/ R. }6 E; [! I$ s' S- C
end1 S. z5 s3 ^. V) @9 p

3 @  y9 p3 L4 Y$ }4 }$ |1 Xbegin P_pick2 arriving; q+ g9 M5 O9 s- U. `' y& ]
    set A_i to 11. d, L/ l* M/ j# f2 P: G: w, X
    move into Q_induct2
, r$ y- z: |) d6 \: g) L# g    move into pickaisle.induct2! c: d) h! Y1 U
    while A_i<=30 do begin6 ~6 S* d7 o# n; A
        travel to pickaisle.con(A_i)0 D/ u& s. ~& b- R8 l" R! m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* T6 N4 a. @1 P        else wait for 10 sec3 v; A- l* {( x, f
        if A_i=A_leave then send to die
3 D- H6 F4 ]* E- @        else inc A_i by 1
; U* H. ]1 i9 d  m% |3 h3 H2 E  b" O: o    end
7 q8 @" a3 H" l+ V$ rend' d  g' P+ B1 R% L+ X9 P. g

7 M% G4 v  X6 \& Jbegin P_pick3 arriving
, Y" k- z' N7 x" k! g- ~    set A_i to 215 a" t7 a  a% k2 m
    move into Q_induct3- u$ m3 Q6 \0 h- y
    move into pickaisle.induct3
4 H* J$ q2 P" _( ?: W8 V' _. S    while A_i<=30 do begin- o3 q) N, T" L/ Y
        travel to pickaisle.con(A_i)
% g1 l1 d; D0 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; p% y, D& x) e. k1 R        else wait for 10 sec
$ w1 ^% J5 j% M$ i' \) M        if A_i=A_leave then send to die; M" Y( R) O" v; _
        else inc A_i by 15 ^. f0 f, ?: K7 N* G
    end
" s: p7 j2 ~% X. J, qend

最佳答案

查看完整内容

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是个什么东东?
, o* V) {% H8 V4 x$ Jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, n$ g1 ~0 O7 g# @1 j) R

$ m8 K5 }4 n) i8 ^4 ~AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 Y- [0 l; m9 q+ p5 |5 [

' e& [3 \! ~4 |0 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ |- ^+ h- ?8 d* K+ C4 u7 ?1 q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ g" p8 ~  o& a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. D$ e7 n, w0 T9 A3 D3 e
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 j5 F+ q4 }* B% {  Nbegin P_induction arriving2 [8 w- c- q! \- L
    clone 1 load to P_pick(A_induct)
7 R& |/ W0 c% R+ q- j: W( Dend最大的系
$ E/ o3 R0 C5 i1 N* {5 V9 q3 S
" k9 v! T# w2 ]# R' W: v3 g4 Ybegin P_pick arriving7 I7 {, ?) L; e, W/ E
    set A_i to procindex * 10 + 1
9 D5 f& }$ n( r) d& }    move into Q_induct(procindex)1 o  s# T# e2 ^+ J
    move into pickaisle.induct(procindex)
1 k3 ?! x. K! t, B6 z    /*check the type of pickaisle.induct(i), for your last problem.*/
! k5 {; z  `0 t. w0 x6 p/ `4 y/ B& }8 U) K
    while A_i<=30 do begin/ V) B4 `2 P- V$ n
        travel to pickaisle.con(A_i)
1 y! b! ]5 N* a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ @2 ], B, t  m$ K) a
        else wait for 10 sec
+ G0 U' W1 C7 v4 V$ p0 o: z        if A_i=A_leave then send to die
, L9 R9 R0 `6 D3 x, m        else inc A_i by 1( ]5 _) v7 |, I& J  T
    end
, u# l9 @; v3 m+ Q: Bend( C9 w4 S. d$ s5 B1 C1 k! [
4 S$ a9 r+ G% y& r0 D! R
其中的procindex为整形,代表当前process的序号。; j! u1 u) Y5 A" z: q1 F
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-7-1 04:34 , Processed in 0.013472 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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