设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12985|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Q2 e" I6 |5 o: k3 U5 O+ T
: ?1 V" q4 w& v( v' f- 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 n2 r6 ^* K- Y( a* p4 k' K) I
# ^- A+ Y" |2 q$ R0 D3 U; |
begin P_read arriving1 g/ J, @* M; j. ?' l
    while 1=1 do begin# t8 B3 c' w* d9 f4 ^
        read A_tote from "data.txt" with delimiter "\n"* b  g% K8 w$ J' ?7 Y1 F+ S
        read A_time from "data.txt" with delimiter "\n"
8 u( A6 l: ^) y        read A_leave from "data.txt" with delimiter "\n"0 m9 y4 A/ C& T' `
        read A_picks from "data.txt" with delimiter "\n"
) h; y6 T2 s# Z( U9 ?        set load type to A_tote( }" x2 \7 [5 Y$ h" ~
        if A_tote="tote 1" then set A_induct to 19 O; Q9 X2 c- M7 f, |4 C
        else if A_tote="tote 2" then set A_induct to 2
8 C( ^- x( o* P; R8 b            else set A_induct to 3   
+ L6 O$ L6 s) g2 D: i0 Q* S) o3 `        set A_i to 0; o! P9 I) O( S4 B* p" U" C
        clone 1 load to P_induction9 s" j1 u" z  G4 z7 c! D( X$ X
        wait for A_time sec2 [) A; `; z* K, w3 @1 U' o) c
    end
7 j7 f, M! g1 `' a1 Gend" O4 f; G- T8 C& L0 ~. I( P. W9 c
2 m4 @! l/ n  S/ @4 R3 [. j* a
begin P_induction arriving
1 P* E* r. C; @, Y* v# f+ R    if A_induct=1 then clone 1 load to P_pick1& ?1 Q* E( Z& b9 `/ M+ |( r- B1 O# j
    else if A_induct=2 then clone 1 load to P_pick2" @* K/ f# ~! ^. U( T9 z
        else clone 1 load to P_pick3( Q& S) ]) B; G
end
  |: m+ ]" o' ^3 i! a! U  Z- e. Q2 _4 C- @. k: ]
begin P_pick1 arriving0 n, G+ `: d; s4 K( S
    set A_i to 1
7 P" E" \3 S' ~; p    move into Q_induct1
% v& ~0 j6 A4 w    move into pickaisle.induct1
; t+ p, W/ J& j$ M- P! _( ^    while A_i<=30 do begin8 }0 O: J$ {) e: g9 D
        travel to pickaisle.con(A_i)
, P0 J8 m" I0 I% K& X* a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ {* n1 j0 k! l
        else wait for 10 sec8 K1 I* Z0 c  C
        if A_i=A_leave then send to die. ]% R  \3 X9 r3 z& H
        else inc A_i by 1
! |7 A, o7 n# R& ~    end
# c5 v4 _' L; @' tend8 d. s2 {1 o+ W2 ~% z2 G
6 a0 l" i* d( O- }9 B, N* _
begin P_pick2 arriving
5 v5 }5 h3 r2 k2 y4 f3 X0 B' @- _    set A_i to 11
; L. G- e' l& }: K3 E    move into Q_induct22 x! Q1 W2 x/ }/ p* g( l- N
    move into pickaisle.induct2
$ ?* Q" h) f, N: y9 C/ K$ N    while A_i<=30 do begin
9 |, [- w! F- O) `0 ]# b        travel to pickaisle.con(A_i)2 @  w- ~) i: t& G( Q, ]7 f! `' I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 x9 K# M  m) R
        else wait for 10 sec7 F. w2 g2 m( n% K& j6 Q
        if A_i=A_leave then send to die
( G5 u8 {$ h( ^        else inc A_i by 12 r3 k1 c6 J8 T7 Z. q! r# ?. z) l
    end
0 J4 q% E; ]# Fend
) g! b( k5 \, H  d
- ~% g! s7 ?3 p6 A, E5 e# C5 @$ Zbegin P_pick3 arriving. q# Y! o7 o6 G
    set A_i to 21
; Q# ^( W1 q; Z- Y) g2 x/ i4 H9 l    move into Q_induct3
; z6 X  ]0 p: k. P. [8 t+ H    move into pickaisle.induct3
8 M% o5 G/ K% I6 c- x# f' a    while A_i<=30 do begin4 p* m' s; K+ \9 s
        travel to pickaisle.con(A_i)
- O, j+ k3 e8 C( k( g( ^* M% x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 c9 O* B/ j2 k0 u8 c/ l: \0 C6 M
        else wait for 10 sec
* B8 e6 u+ F7 W        if A_i=A_leave then send to die
$ W- }6 b% u# S6 a- w3 s6 N3 x( s6 h- o        else inc A_i by 1
$ f) A( Y. `" Z    end
8 k$ n% I0 g" P5 {- vend

最佳答案

查看完整内容

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 d9 s5 ^; f4 w7 B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 e/ e" c6 C: |* a# L+ U( d, w- [) d7 j
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: A' d0 Y) y! m2 ^: u# P% T
+ V8 T3 E& n2 Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 C4 U" K) y/ w7 T& \1 q- A
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# J$ d& H5 ?+ z' l
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 [! @7 t3 W6 w3 u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 S6 j7 U6 S( Q2 _% ^
begin P_induction arriving
" W4 k4 j: m& i5 T6 j/ R$ @& h    clone 1 load to P_pick(A_induct)
5 Q3 q& Y1 f) Vend最大的系
) \3 @) ?1 Y+ L# ?" `/ W' w
- q/ M7 @% v" ebegin P_pick arriving+ @% z# }/ D/ Q$ Q# v6 K
    set A_i to procindex * 10 + 1
. X+ Q+ u0 V1 u1 t- D    move into Q_induct(procindex)
5 ~& q3 |- y' e5 [' Z/ f: P. y    move into pickaisle.induct(procindex)1 T& r) k6 p. ~
    /*check the type of pickaisle.induct(i), for your last problem.*/" n# [1 ~' y9 Q
2 G6 u; q% Z- Y# l, r. u2 F5 A
    while A_i<=30 do begin7 p, D% J9 i2 S. l. I; {, M. u
        travel to pickaisle.con(A_i)
' p  H* j9 Y1 s4 L6 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* @' k3 v4 j9 p6 Z% {
        else wait for 10 sec  n: d2 e6 e9 \: H- Y) J
        if A_i=A_leave then send to die/ R( K! N1 R% i4 F5 H/ W( E
        else inc A_i by 1
; Q1 R3 ]! D7 z1 Y/ b    end
, Y+ h5 a: i; O* e* k( b( qend0 O+ T' A! Z2 s9 q) b: P9 g

! Y3 c; f$ `! I9 g& o/ J其中的procindex为整形,代表当前process的序号。, Q; ]- X& g, r! a/ Z& y
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-3-8 05:13 , Processed in 0.015811 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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