设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11980|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) G% p. E; d7 y" V/ Z$ }$ E

2 b. j5 e. Y+ r; t我的问题是,在每个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中的数值,不知道会不会有什么不妥。& ]9 |9 a' r* B! E% f- k

. B, t5 `5 w3 K, |begin P_read arriving
: w) x3 R0 d! v2 L& f    while 1=1 do begin- O: W3 f0 c) V* n) {* q6 k
        read A_tote from "data.txt" with delimiter "\n"; f2 C5 F3 w3 \" ~/ U; Y
        read A_time from "data.txt" with delimiter "\n"1 @4 X: c' t' i5 o, g
        read A_leave from "data.txt" with delimiter "\n"/ n1 z& N* D3 O& T! Q
        read A_picks from "data.txt" with delimiter "\n"
6 N) T& Z+ }; c+ i% N  t        set load type to A_tote
& A  r- E$ X& B' [) I! x  V$ w& Q        if A_tote="tote 1" then set A_induct to 11 R0 D1 t% s' W$ |2 c, M+ {
        else if A_tote="tote 2" then set A_induct to 2; G1 H. W$ a  S+ v; r  F
            else set A_induct to 3    3 K9 E! d; T* v
        set A_i to 0
, B2 H, P' X2 g" T; a        clone 1 load to P_induction7 B7 \; m! `0 Z
        wait for A_time sec
; O9 G. N, D2 q+ N# M+ \& B    end
' V0 Q) H, g2 _end
. t$ s' l3 y% q4 z1 E5 @+ h
$ m& [3 \$ S+ |  G1 ]  |begin P_induction arriving% Z0 p% L+ t- E, G1 F1 @3 z0 w
    if A_induct=1 then clone 1 load to P_pick1
3 Z/ M9 k0 b9 K    else if A_induct=2 then clone 1 load to P_pick2
0 N: [2 I9 i5 \. B        else clone 1 load to P_pick3
2 T. p9 W9 V* p4 {+ d% |# Jend! o* V0 ~" R/ k& c! Y0 O5 e) S
/ z, f& E: w; @
begin P_pick1 arriving
) g) z  d4 x$ h& [+ Q    set A_i to 1. ]& ^- A* O( _% g& |
    move into Q_induct1
7 s' ?6 |3 s$ i* \  j$ E, k    move into pickaisle.induct1! L7 v8 D0 v6 r" l# M2 r& b
    while A_i<=30 do begin2 t  j5 J' t- m: n% O# b
        travel to pickaisle.con(A_i)
0 [6 Q7 Y6 b# E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 }; t5 I+ m, i4 V$ n( b        else wait for 10 sec
3 G6 o. o. X4 s0 b  M5 |; G        if A_i=A_leave then send to die6 v1 [. e4 Z8 l% C6 c
        else inc A_i by 1# ]0 e3 d; j9 |* G2 L
    end. o( @$ Q( k- g) e1 c0 K8 J, E
end
8 {1 v2 I  {( t; k8 H& W6 E
0 u' v% Z# F! J4 g$ Bbegin P_pick2 arriving
4 a9 R( @- j- t* n5 @    set A_i to 11- z; j) ]5 E/ ^) U, T  {1 t
    move into Q_induct2
- {$ `: X' j/ {; q- J$ \    move into pickaisle.induct2
8 i8 E! E$ \5 M8 T& V- W0 ]    while A_i<=30 do begin$ b' F: I9 z" f; |' Z
        travel to pickaisle.con(A_i)# M- C0 v( c  V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' v  A! ^, s) I5 H9 t  {+ d
        else wait for 10 sec  `7 D" r! b# O; {. T' Q
        if A_i=A_leave then send to die
# z' s" Y9 T1 m, {! x        else inc A_i by 1
' p! a& \1 p- F8 c8 c- g- w    end# i0 M4 |) x5 [% C
end
. F+ n5 Q1 F4 F: Z* j
) e& m0 ]; X- F; xbegin P_pick3 arriving
9 x. V6 P* w: I    set A_i to 21
( z1 O3 U8 b" y4 g+ Y( h0 U5 }/ P    move into Q_induct3  r" f3 B" h: ?2 [, X/ D
    move into pickaisle.induct3
! G' M" P/ p( }8 ^! S    while A_i<=30 do begin& }* B( R/ b! k0 y+ ~
        travel to pickaisle.con(A_i)
3 ~2 j" v8 ~% a# y7 W, M4 O2 \% w9 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ?3 n1 K2 Z" d8 K) |. U0 m" m
        else wait for 10 sec# N1 b% o, r6 c9 w; E6 r6 ~
        if A_i=A_leave then send to die1 ~0 x" C) r. T2 u# x* Y
        else inc A_i by 1" K7 O0 u+ g9 {7 n
    end9 n# b+ E$ x9 H3 I) F' S
end

最佳答案

查看完整内容

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是个什么东东?4 q: t* c# d& r: S' M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( s6 F8 o# `9 o8 }0 V  @' Y
5 U& ^8 a, h6 BAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# X, g3 G" }3 Y6 |1 G8 s- `; @
& P8 U  S1 K, Q& W0 ]7 p( n另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ I( q% y* w: L9 g# U% m4 _1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 X( E( t+ f. S: {4 s  \2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- v' t( F3 o+ C; Z& _4 U
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; N6 t1 @4 ?2 m, X4 J6 ^- u" rbegin P_induction arriving
" F, n* M2 R9 }' q6 ~0 W: |    clone 1 load to P_pick(A_induct)2 z1 G2 ?& P: g
end最大的系6 Y: k' u9 k0 Y6 N  i
! b% @0 X6 d; \4 {5 M! q
begin P_pick arriving
2 D- a7 C7 \: [    set A_i to procindex * 10 + 1
  M1 M) i$ M* Z- j9 p    move into Q_induct(procindex)) k# K5 S2 K* ]0 s% s
    move into pickaisle.induct(procindex)# l4 y4 ^( t7 P$ Q3 R5 Z1 y" b
    /*check the type of pickaisle.induct(i), for your last problem.*/1 v7 ]# o, h1 [! o; G. H8 V* T; g

* y+ |0 _/ X6 m7 j/ z$ A    while A_i<=30 do begin
% W/ [5 H; W" s! @8 g, W: a        travel to pickaisle.con(A_i)
7 I+ V  c, U/ {$ W2 {% T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ i0 _8 d; g  ~4 P        else wait for 10 sec% s0 ^; D# i6 W) x. j2 Q
        if A_i=A_leave then send to die: b! N% b2 h1 y+ ?' Q) m
        else inc A_i by 1
8 q1 `9 g1 N3 f+ D7 [    end
, L5 Q+ p2 z+ r9 x" Cend
9 D% s+ I( c$ z' y: m0 o+ F$ v/ P8 m: i1 m4 S* s- X7 j
其中的procindex为整形,代表当前process的序号。9 U& e  F3 D+ d  u
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, 2025-12-18 15:24 , Processed in 0.015722 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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