设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14238|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& }+ `8 M- |8 L8 P% ^7 s" s8 q/ f, c8 O# {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ o$ U1 ?- J4 ^6 [( b
' h6 H) x3 e8 |& u+ D
begin P_read arriving! S$ {$ o+ J5 W- k
    while 1=1 do begin- f8 ~% X& j8 H/ e7 m" P
        read A_tote from "data.txt" with delimiter "\n"( p$ H( g! q+ P3 k  @3 C
        read A_time from "data.txt" with delimiter "\n"( I& Q2 P. M( h4 Z
        read A_leave from "data.txt" with delimiter "\n"
1 r$ e: g2 y- D% Z; \6 C9 Q        read A_picks from "data.txt" with delimiter "\n"
( K) H7 t! j2 R        set load type to A_tote; h! Q& ?7 ?3 X1 t/ K7 v; n; D
        if A_tote="tote 1" then set A_induct to 19 h1 P2 h* r. g- \; s( b3 N4 H
        else if A_tote="tote 2" then set A_induct to 2) U- r- Y  q5 t' j
            else set A_induct to 3    & i9 R4 Z1 d5 j
        set A_i to 0
# l2 C, O+ X' |1 d9 h! D' |        clone 1 load to P_induction5 o" g; e9 q; u3 a/ Y1 k( r
        wait for A_time sec
% N8 U) y6 Y5 p! L    end& C$ f- z. p& L& }
end
6 g  ^/ Z5 i. g
/ v3 h# h# A% ?% ]' Z5 n! e% ~begin P_induction arriving% V' k" V$ f3 B5 ]* S9 k
    if A_induct=1 then clone 1 load to P_pick1' R$ A$ g+ C/ J5 T4 u7 A. j
    else if A_induct=2 then clone 1 load to P_pick2. }% e* }9 W$ H3 b# ]$ z" H8 G) ]; C
        else clone 1 load to P_pick3
% K% ?* w" [* x% m+ n' V! @end
0 s! V% d6 j! R0 a& I8 p$ z" i
; H7 v, s; T8 x4 b5 tbegin P_pick1 arriving1 y) L  Y( f" g0 i; Q# h
    set A_i to 1
8 N9 y- y+ l% ~3 M# F    move into Q_induct1
1 i; R2 }& V9 Z2 p. u    move into pickaisle.induct1) k4 z; F: u2 O" g2 n( e6 K
    while A_i<=30 do begin
' d3 J! A3 ]0 A0 I1 `6 [        travel to pickaisle.con(A_i)6 y. a7 k/ W& Z$ _) w8 T) j& [) A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# N; @: ]4 l0 }
        else wait for 10 sec
$ K& J  w: ~, _& ^' X2 v/ H4 M( s) }        if A_i=A_leave then send to die
8 g' E! e  {/ ^: e5 u; M9 T- ~        else inc A_i by 1
3 ~) i& L8 @( \! r1 I    end
) a  O& c6 l! v+ y5 Kend' K' b# p/ G9 h6 S. O/ O# T

7 d% P8 w" e6 jbegin P_pick2 arriving
9 I) |  U$ M# a7 H    set A_i to 111 Z( u3 X- `* @! q
    move into Q_induct2
# U6 v, E* B( t8 r    move into pickaisle.induct2& ]! X% q% M, `% k- ?6 x
    while A_i<=30 do begin
+ P: r; M" D$ I. Z+ l7 [4 x        travel to pickaisle.con(A_i)
, x( _6 W3 s. Z# p. T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) X  S% n" N- ~5 N% e; Y        else wait for 10 sec& ?0 n4 L! S' U* ?4 h5 v7 X1 L* t
        if A_i=A_leave then send to die  A/ D) o& ~8 e+ v- m/ k. h& o
        else inc A_i by 1) L2 `& A" }0 y
    end
" t# X- v$ a' Q. e% V: wend) A# W) F# u/ Z2 a

. j# e# `- ~! z3 }begin P_pick3 arriving
6 B/ Z4 Q% O( V+ q    set A_i to 21
2 W; C3 t' R& v0 x$ `    move into Q_induct3
8 ?; i  d  k! ^2 ^9 p7 d0 l- `* P4 l8 T    move into pickaisle.induct3
0 q( T# q# _( k$ N& ]    while A_i<=30 do begin3 g; t  g0 K7 m5 ^# i
        travel to pickaisle.con(A_i)
( k" C! n: ]' q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* r/ d  D* M7 M& {
        else wait for 10 sec! c( i8 g6 O! Z+ f2 f
        if A_i=A_leave then send to die
! u% T: c3 m. ~: q* l' C        else inc A_i by 1
2 J: i& W9 Y: D& a0 z    end' v# Y  B. D1 I7 e7 x" m
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是个什么东东?
/ Q" Q% ^6 H; U- u4 r9 ]2 Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 l7 V! ?) U" r& v5 O) U. J, I4 Y/ J! n
" y; ~  b) B1 J" K/ P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ [3 v' @" U0 d; U% N  D

6 E7 n' I- {' c) _/ |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ y6 H9 l1 U- r! j: I7 D: W8 i/ N2 R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) l( A* I( L* _
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" r9 Z! z5 v: k" q( ^( \9 K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' Y* B' o4 p+ O3 Obegin P_induction arriving
+ g; S" z6 J: u6 ]$ t/ K5 e; o    clone 1 load to P_pick(A_induct)' O5 ]  x! Q5 y3 X* `
end最大的系: n# k5 o  O2 S/ x- o; Z4 K1 m0 b6 s

$ K( W. J; O+ P, i+ dbegin P_pick arriving2 R5 g, Z) ?5 r9 A( U; u6 a( A
    set A_i to procindex * 10 + 1- W8 O# [* Y7 t  ^
    move into Q_induct(procindex)
7 V# E4 Z- _, F7 x    move into pickaisle.induct(procindex); y0 @. n+ G/ i% m. z7 q% C
    /*check the type of pickaisle.induct(i), for your last problem.*/9 P6 k; [/ i" J2 d2 h$ I
- \4 t2 a: ~+ N- D; o2 L6 \. j
    while A_i<=30 do begin4 q( ^* R3 }7 M
        travel to pickaisle.con(A_i)7 m! I1 D- U, M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 `) y$ T, k' B0 R+ ?
        else wait for 10 sec) ?" P) z# v4 e. X" H4 w
        if A_i=A_leave then send to die. n- H0 Z  k- ~' d$ _3 T
        else inc A_i by 18 T$ l5 U* j+ I" Y6 O% F
    end
% b) Y" O9 P6 u9 {  iend& f( F9 H9 {3 C3 x! h

+ f$ H& W, x: M! q" Q其中的procindex为整形,代表当前process的序号。1 J, e( A, F; \% N' R7 ~; r
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-6-23 17:31 , Processed in 0.013546 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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